< Return to Video

Decoding the LoRa PHY (33c3)

  • 0:00 - 0:14
    33c3 prerol music
  • 0:14 - 0:19
    Herald: As mentioned before, Internet of
    Things, it would be great if it would work
  • 0:19 - 0:25
    and one big part of Internet of Things is
    the Internet part. So stuff has to talk
  • 0:25 - 0:30
    and cables are shit. So we use Wi-Fi and
    other wireless protocols. So our next
  • 0:30 - 0:35
    speaker is going to take a very close look
    at the physical layer of LoRa, a low power
  • 0:35 - 0:41
    wireless area network, and he built some
    stuff to actually sniff what's happening
  • 0:41 - 0:47
    and inject stuff. And apparently he
    offered his sacrifices to the gods. So
  • 0:47 - 0:51
    we'll see something. Please give a warm
    round of applause to Matt Knight.
  • 0:51 - 0:55
    applause
  • 0:55 - 1:01
    Matt Knight: Thank you for that warm
    introduction and thank you all for coming.
  • 1:01 - 1:04
    I'm really excited to be here. So for the
    next hour or so, we're going to be talking
  • 1:04 - 1:09
    about the LoRa failure. And LoRa is a low
    power wide area network, wireless
  • 1:09 - 1:15
    technology that is designed for the
    Internet of Things. So first, a little bit
  • 1:15 - 1:18
    of background. Myself, a software engineer
    and a security researcher with bestial
  • 1:18 - 1:21
    networks, I have a bachelor's in
    engineering, electrical engineering and
  • 1:21 - 1:25
    better systems from Dartmouth. But really,
    my interests are in applied RF security
  • 1:25 - 1:28
    research. So that means everything from
    reverse engineering wireless protocols to
  • 1:28 - 1:32
    developing functional based bands and
    software and HDL and also all the way up
  • 1:32 - 1:36
    to software networking stocks. So all
    these things are interesting, interesting
  • 1:36 - 1:40
    to me, but I'm really excited about the
    material we're going to talk about today.
  • 1:40 - 1:43
    So before we get started, there aren't
    going to be any like zero days or
  • 1:43 - 1:47
    traditional security related exploits
    here. But we are going to take apart a
  • 1:47 - 1:51
    cutting edge wireless protocol. Let's talk
    about why that's important in a minute.
  • 1:51 - 1:55
    But first, I'd just like to survey the
    room and get a sense for who's here so I
  • 1:55 - 1:58
    can figure out where to spend more of my
    time. So if you'd be so kind as to raise
  • 1:58 - 2:03
    your hand if you've heard of software
    defined radio. That's a lot of hands.
  • 2:03 - 2:06
    That's great. OK, how about raise your
    hand if you know what is best for you,
  • 2:06 - 2:13
    transform is awesome. And how about a
    symbol in the context of wireless wireless
  • 2:13 - 2:20
    systems? OK, cool, this we're going to do
    well, this is going be fun, so why why is
  • 2:20 - 2:25
    this sort of network forensics interesting
    or why is it relevant? Why is this
  • 2:25 - 2:28
    important? The Cisco Internet Business
    Solutions Group has a figure that I really
  • 2:28 - 2:33
    like that states that by 2020 they're
    going to be 50 billion devices connected
  • 2:33 - 2:38
    to the Internet in some way. As we know,
    with the growth of mobile and the Internet
  • 2:38 - 2:40
    of Things, fewer and fewer of those
    devices are connected with wires every
  • 2:40 - 2:45
    year. And as we know, tools like Wireshark
    and Monitor Mode weren't always a thing,
  • 2:45 - 2:50
    even for common interfaces like Wi-Fi and
    able to 11. Those those tools that we come
  • 2:50 - 2:54
    to rely on every day exist because
    somebody thought to look below the layer
  • 2:54 - 2:59
    they had and make it. And I believe that
    low level security, low level access to
  • 2:59 - 3:03
    interfaces is essential for an enabling
    comprehensive security on various
  • 3:03 - 3:09
    interfaces. So we're going to begin by
    discussing L.P winds at a high level and
  • 3:09 - 3:11
    then we're going to do a little bit of a
    background on some technical radio
  • 3:11 - 3:15
    concepts just so we can level out our
    domain knowledge and inform the rest of
  • 3:15 - 3:19
    the conversation. Then I'm going to take
    you through my recent reverse engineering
  • 3:19 - 3:23
    of the law failure that was powered
    through separate fun radio. And finally,
  • 3:23 - 3:28
    I'm going to give you a demo of this tool
    called Jaala that I've made. That is an
  • 3:28 - 3:32
    open source implementation of of this FI
    that will enable you to begin doing your
  • 3:32 - 3:39
    own security research with it. So to
    begin, what is LoRa, what is this thing?
  • 3:39 - 3:44
    It is a wireless Iot protocol and Iot is
    in red because some of us are are
  • 3:44 - 3:49
    marketers. We're all engineers. We know
    that this is a dirty term. Right? Iot is
  • 3:49 - 3:53
    really code for connected embedded devices
    and there are tons of common standards for
  • 3:53 - 3:58
    embedded systems already. Everything like
    ITOCHU 54 and all of its friends like
  • 3:58 - 4:04
    Ziggy and six Lappin, Itochu, eleven wi fi
    and then also more common things like
  • 4:04 - 4:09
    Bluetooth and Bluetooth, low energy. And
    the list goes on. Right. We've got all
  • 4:09 - 4:12
    these standards. What is wrong with them?
    Why don't we just use just one of these
  • 4:12 - 4:16
    existing ones? Well, all the ones we just
    mentioned all require some degree of local
  • 4:16 - 4:21
    provisioning. You need to connect your
    device to in side or hook your your Zuby
  • 4:21 - 4:24
    device up to a coordinator in order to get
    a communicating. Some of them require
  • 4:24 - 4:30
    gateways to talk out to to the Internet.
    And in the case of eight to 11, it's very
  • 4:30 - 4:35
    power intensive. So you can't run a device
    for a long time on a battery. So what's
  • 4:35 - 4:40
    ideal? What about cellular cellular works
    everywhere? It's easy to install. You
  • 4:40 - 4:43
    don't have to worry about any hardware on
    premises. As long as you can talk to a
  • 4:43 - 4:48
    tower, there could be miles away. You're
    good to go. Well, it's power intensive and
  • 4:48 - 4:52
    in the case of certain types of the
    standards, they're going away. And I'm
  • 4:52 - 4:58
    talking about to give us an edge service
    in in the United States. AT&T, one of the
  • 4:58 - 5:02
    largest carriers, is saying they're going
    to sunset their 2G network in about three
  • 5:02 - 5:08
    days in Australia. This has already
    happened. Telstra, which is one of the
  • 5:08 - 5:12
    largest telecom companies in Australia,
    sunset their GPS service earlier this
  • 5:12 - 5:20
    month. And all the other major carriers
    are soon to follow. So 2G is is works
  • 5:20 - 5:24
    everywhere. It's very battery conscious
    and it's fairly cheap. So this is exactly
  • 5:24 - 5:30
    what the Internet of Things needs to to
    power its communication standards. Now,
  • 5:30 - 5:34
    say you're a developer and you want to
    move on to a new wireless standard that
  • 5:34 - 5:39
    won't, you know, deprecate in three days
    you can either go to 3G or more modern
  • 5:39 - 5:43
    cell stack, which which comes with a more
    expensive radio and harder power
  • 5:43 - 5:48
    requirements. Or you can wait for the 3G
    up, which is the standards body that makes
  • 5:48 - 5:54
    and maintains the cellular standards to
    come out with their Iot focused, with
  • 5:54 - 5:58
    their Iot focused standards that are
    currently in development. And the
  • 5:58 - 6:01
    indications that I've gotten state that
    those won't be ready until the end of next
  • 6:01 - 6:04
    year, really at the earliest. So it's
    gonna be the end of twenty seventeen at
  • 6:04 - 6:08
    the beginning of twenty eighteen before we
    start to see these things in the wild,
  • 6:08 - 6:13
    which means that until then there's a
    massive hole in the market. So if you want
  • 6:13 - 6:16
    to, if you want to develop a embedded
    system that requires this type of
  • 6:16 - 6:20
    connectivity, you're going to have to look
    elsewhere. And that brings us to the topic
  • 6:20 - 6:24
    of low power, wide area networks. And you
    can think of these networks as being just
  • 6:24 - 6:29
    like cellular, but optimized for Iot and
    M2M communications. The architecture is
  • 6:29 - 6:32
    almost exactly the same and that you have
    a network of base stations or gateways
  • 6:32 - 6:37
    worldwide and then end nodes uplink
    directly to those base stations without
  • 6:37 - 6:41
    any meshing or routing among themselves.
    It's just like a star network. Basically,
  • 6:41 - 6:45
    you have these nodes, the connect directly
    to the base station and they have a range
  • 6:45 - 6:50
    on the order Miles. It's a very similar
    topology to cellular. There are tons of
  • 6:50 - 6:55
    standards that are there are popping up
    more and more every day. But the two that
  • 6:55 - 6:59
    have the most momentum are LoRa and Sigge
    Fox. There's been a ton of investment in
  • 6:59 - 7:04
    both of these technologies, actually. Just
    last month, LoRa Ersek Fox closed a
  • 7:04 - 7:10
    hundred and fifty million Euro Series F,
    some late stage funding round in the Wall
  • 7:10 - 7:14
    Street Journal, wrote an article recently
    that stated they were investigating a U.S.
  • 7:14 - 7:17
    IPO soon. Additionally, Senate and
    activity, two of the biggest backers of
  • 7:17 - 7:22
    the wharfie have raised a combined fifty
    one million dollars in the last year or
  • 7:22 - 7:26
    two, so one from raising one hundred fifty
    million dollars, they're absolutely going
  • 7:26 - 7:31
    for it. They're investing like crazy in
    these technologies. So when we say that
  • 7:31 - 7:33
    these networks are optimized for the
    Internet of Things, we're really talking
  • 7:33 - 7:38
    about two things. They're battery
    conscious sic. Fox advertises that they
  • 7:38 - 7:41
    can get up to 10 years of battery on the
    amount of energy and a single AAA battery
  • 7:41 - 7:46
    and their long range. And if you turn all
    the knobs and LoRa just right and have a
  • 7:46 - 7:50
    perfect noiseless channel, they advertise
    that you can get thirteen point six miles
  • 7:50 - 7:55
    on one of these very long range devices.
    And if you compare that with, you know,
  • 7:55 - 8:00
    some of the standards we talked about
    earlier, that's pretty competitive. So how
  • 8:00 - 8:03
    how do they do that? How does that work?
    Well, they've designed the entire system
  • 8:03 - 8:07
    around the fact that they're willing to
    accept compromises in the protocol and the
  • 8:07 - 8:11
    functionality of these devices. When I
    talk about compromises, I'm talking about
  • 8:11 - 8:17
    aggressive duty cycling, both transmitting
    and listening, very sparse data, grams, so
  • 8:17 - 8:22
    tiny packet sizes. And they're highly
    limited, meaning they can't send that many
  • 8:22 - 8:27
    packets that often. Now, for example,
    signal limits. This is built into the FYE
  • 8:27 - 8:33
    limits devices to 140 12 byte data grams
    per day. That's like that's like nothing.
  • 8:33 - 8:39
    I think that's less than like a look at to
    you. It's tiny now and then weightless in
  • 8:39 - 8:45
    another LP when standard is uplink only.
    So it can only send messages up to Gateway
  • 8:45 - 8:49
    but can't receive any downlink. So for
    example, if you had a device deployed, you
  • 8:49 - 8:53
    can never deliver firmware to it later
    unless you rolled a truck to it or climbed
  • 8:53 - 8:57
    up the telephone pole to where it's
    mounted. And finally, LoRa, classi devices
  • 8:57 - 9:03
    can only receive downlink for a brief
    window after they uplink. So if you're if
  • 9:03 - 9:06
    you're an application operator and you
    want to send a message to a device you
  • 9:06 - 9:09
    have in the field, you have to wait for
    that device to call home before you had
  • 9:09 - 9:14
    your brief window to tell it what you
    want. So these systems are built around
  • 9:14 - 9:17
    compromises, but that's what enables them
    to get some pretty incredible performance.
  • 9:17 - 9:23
    All right. Let's get into the details with
    LoRa. So LoRa is an LP when it's developed
  • 9:23 - 9:28
    by some tech, which is a French
    semiconductor company. Biffy was patented
  • 9:28 - 9:36
    June in 2014 and LoRa when McCan network
    STAC was published in January of 2015. So
  • 9:36 - 9:40
    this this entire standard is less than two
    and a half years old. It's brand new and
  • 9:40 - 9:42
    it's supported by an industry trade group
    called the LoRa Alliance, which has
  • 9:42 - 9:47
    tripled in size every year since its
    founding. So growing quite a bit before we
  • 9:47 - 9:51
    move on. Just want to clear up some
    nomenclature that will help us focus in on
  • 9:51 - 9:58
    what this talk is going to center on, and
    that is disambiguate. LoRa and LoRa, when
  • 9:58 - 10:03
    LoRa refers strictly to the player, the
    physical layer of the standard, LoRa when
  • 10:03 - 10:07
    defines a Mac and a networking, some upper
    layer stacks that right on top of LoRa,
  • 10:07 - 10:12
    the LoRa Wanne standard, the upper layer
    has been published and that's public. But
  • 10:12 - 10:18
    the FIGLIA itself is totally closed. So
    the LoRa, when upper layer stack gives
  • 10:18 - 10:22
    some information about its topology, it's
    kind of interesting, suggests that they
  • 10:22 - 10:27
    were really thinking about security when
    they designed it. There are kind of four
  • 10:27 - 10:31
    stages in the network all the way out in
    the field. On your sensor you have the
  • 10:31 - 10:36
    node and that connects to Gateway over a
    wireless link. That's the LoRa link. And
  • 10:36 - 10:40
    then once you get into the gateway,
    everything from there up is all on. It's
  • 10:40 - 10:45
    all on IP networks, just standard
    commercial IP networks. And then they have
  • 10:45 - 10:49
    roaming that works on different networks.
    So you'll be able to take your device and
  • 10:49 - 10:53
    move to different areas of coverage and
    have it all play nicely. And then you can
  • 10:53 - 10:56
    hook your application server up to that as
    well to receive packets to and from the
  • 10:56 - 11:00
    network servers. It's all over IP and they
    actually went as far as to define two
  • 11:00 - 11:05
    different mechanisms for encrypting it.
    There are two different keys. You have the
  • 11:05 - 11:08
    network key, which goes from the which
    covers from the node up to the network
  • 11:08 - 11:11
    server, and then you have the application
    key, which is actually fully end to end.
  • 11:11 - 11:16
    It goes from the end device all the way up
    to the to the application server. So if
  • 11:16 - 11:19
    you design that right, the network should
    never see your traffic unencrypted. And
  • 11:19 - 11:26
    they also provide a mechanism for having
    unique keys per device. It's built into
  • 11:26 - 11:29
    the standard, but it's not required. So
    it's still up to the implementor to to do
  • 11:29 - 11:34
    that and get that right. So there are some
    good thoughts that went into security with
  • 11:34 - 11:38
    lawin. However, that's not what we're
    talking about today. That's all we're
  • 11:38 - 11:41
    going to say about lawin. We're just going
    to tell you it exists that it rides above
  • 11:41 - 11:45
    LoRa, but we're not going to go into any
    more detail than that. So from here on
  • 11:45 - 11:49
    out, it's all LoRa all the time. We're
    just talking about the file here. So let's
  • 11:49 - 11:52
    get into what makes that really
    interesting. One of the big defining
  • 11:52 - 11:57
    features of LoRa and Cig Fox, the two
    biggest LP wins, is that they're designed
  • 11:57 - 12:01
    to use what are called isman spectrum.
    That's what's called in the United States.
  • 12:01 - 12:06
    It stands for industrial, scientific and
    medical. And what's cool about these these
  • 12:06 - 12:09
    bands is they're what are called
    unlicenced, which means that you don't
  • 12:09 - 12:16
    need a specific license from the FCC or
    you or your telecom regulation. Authority
  • 12:16 - 12:20
    to operate on it. So if you go and you buy
    any Wi-Fi router on Amazon, you take it
  • 12:20 - 12:23
    home, you plug it in, you don't need to
    then go and apply for a specific license
  • 12:23 - 12:28
    to to be able to communicate on it because
    it was built to a certain standard. It is
  • 12:28 - 12:32
    compliant with those unlicensed band rules
    and therefore can just work. So these
  • 12:32 - 12:36
    these devices use that same spectrum, but
    to much greater effect, much longer ranges
  • 12:36 - 12:42
    in a much different use case. So that's
    quite novel. And some other things that
  • 12:42 - 12:47
    use these technologies are, you know, wi
    fi, Bluetooth, cordless phones, baby
  • 12:47 - 12:51
    monitors, things like that. So you can
    think of this as occupying the same space
  • 12:51 - 12:57
    in the spectrum as these. Now, why is this
    noteworthy, well, contrasted with the
  • 12:57 - 13:02
    cellular model where cellular technologies
    use what is used protected spectrum, where
  • 13:02 - 13:06
    you have to have specific rights to
    transmit on it in order to to legally use
  • 13:06 - 13:13
    it. And regular regulatory authorities
    sell the spectrum for fortunes. But
  • 13:13 - 13:15
    billions of dollars is what the spectrum
    sells for in the US. I'm sure it's the
  • 13:15 - 13:19
    same over here. And I just want to call
    your attention to how expensive this is on
  • 13:19 - 13:24
    the left here we have a picture. It's an
    excerpt from a document that I found that
  • 13:24 - 13:29
    was related to the RFQs TV white space
    reverse auction. They're trying to
  • 13:29 - 13:33
    repurpose a lot of spectrum that used to
    be used for digital TV. They're selling it
  • 13:33 - 13:38
    off. And if you want to come in and buy
    some really prime low UHF spectrum to use
  • 13:38 - 13:42
    for whatever purposes you have, mind you,
    this is just one TV station in the New
  • 13:42 - 13:45
    York area. You can get out your checkbook
    and write a nine hundred million dollar
  • 13:45 - 13:51
    check and take over CBS TV in New York. So
    getting into the cellular cellular game is
  • 13:51 - 13:56
    crazy expensive. It costs a fortune. But
    there are a lot of us in here. Maybe we
  • 13:56 - 14:01
    can pass the hat and and buy some spectrum
    at the end of this. So as a result of this
  • 14:01 - 14:05
    unlicensed nature, there are a number of
    different models of commercialization that
  • 14:05 - 14:10
    are starting to emerge. We have the
    traditional telecom model we're seeing
  • 14:10 - 14:15
    through companies like Senate, which is a
    company that deploys home heating, heating
  • 14:15 - 14:19
    oil tank monitoring solutions in the
    United States. They're also opening the
  • 14:19 - 14:23
    network up for Iot applications to right
    on top of that traffic as well. And you'd
  • 14:23 - 14:27
    operate with them just like you would
    operate with like Verizon or AT&T or
  • 14:27 - 14:33
    Deutsche Telekom or whoever whoever you
    work with here. Also interesting is I
  • 14:33 - 14:38
    believe it's CPN has rolled out Laurer, a
    commercial or network lawin network
  • 14:38 - 14:42
    throughout the entire region of the
    Netherlands. So countries entirely covered
  • 14:42 - 14:47
    with LoRa. So that's the commercial side
    in the middle. We also have crowdsourced
  • 14:47 - 14:51
    networks. The one that I like to talk
    about is this group called the Things
  • 14:51 - 14:56
    Network, where basically they have defined
    in the cloud the network server
  • 14:56 - 15:01
    architecture for operating a worldwide
    lawin network. So if you want to provide,
  • 15:01 - 15:04
    Laurieann, service on the Things Network
    in your your area, you can get your hands
  • 15:04 - 15:10
    on Allura Gateway pointed at their network
    servers and basically become become a base
  • 15:10 - 15:15
    station in their network from your living
    room, which is kind of cool. So it can
  • 15:15 - 15:18
    kind of spread and grow organically based
    on the needs of of people like me and you
  • 15:18 - 15:23
    who want, you know, the sort of service.
    Then finally all the way up at the up at
  • 15:23 - 15:28
    the kind of independent amateur side, we
    have people like Travis Goodspeed and some
  • 15:28 - 15:32
    of his friends that are working on a
    technology called LoRa Him. And that's
  • 15:32 - 15:35
    leveraging the fact that you can actually
    get more radios that work in workaround
  • 15:35 - 15:39
    for thirty three, which is in the I think
    it's the 70 centimeter hand band in the
  • 15:39 - 15:43
    United States. So you can actually put a
    reasonable amount of power behind LoRa
  • 15:43 - 15:48
    into tech based communications in the
    clear. So they're developing a Allura base
  • 15:48 - 15:53
    mesh networking system for doing basic
    like ASCII packet radio and communicating.
  • 15:53 - 15:58
    It's not public yet, but I like Pete. He's
    blessed me to come and tell you that he's
  • 15:58 - 16:02
    that he's working on this and it should be
    out soon. So there are all sorts of
  • 16:02 - 16:06
    different ways to use these technologies.
    So this is a very different paradigm,
  • 16:06 - 16:10
    which we're used to. And it's opening up
    lots of different opportunities for how
  • 16:10 - 16:14
    this technology might be used and grow.
    OK, so that wraps up our background on
  • 16:14 - 16:19
    LoRa. We're about to get into some really
    technical stuff, but before we do, I want
  • 16:19 - 16:23
    to go through a very short crash course on
    some basic radio fundamentals to try to
  • 16:23 - 16:27
    even the playing field so that we can all
    understand this. And I call it the
  • 16:27 - 16:31
    obscenely short radio crash course. But
    with apologies to any use a real telecom
  • 16:31 - 16:37
    whizzes in the room. I think this is
    probably more appropriate. We're going to
  • 16:37 - 16:40
    we're going to blow through this material.
    And I'm just going to try to pick out a
  • 16:40 - 16:45
    few points that are really essential to
    understanding the rest of this talk. I'll
  • 16:45 - 16:47
    tell you what's important and just try to
    grab those concepts and we'll reiterate
  • 16:47 - 16:51
    them later as we go through it. So, again,
    we're going to be talking about the
  • 16:51 - 16:57
    physical layer. And if you think about the
    Ossi data model that we've all seen, the
  • 16:57 - 17:01
    physical layer refers to how your bits,
    your data get mapped into physical
  • 17:01 - 17:05
    phenomena that represent them in reality.
    And when you're dealing with wireless
  • 17:05 - 17:12
    systems, the mapping maps, the bits into
    into patterns of energy in an RF medium,
  • 17:12 - 17:17
    RF sensor radio frequency, and there it's
    basically electromagnetic waves or energy
  • 17:17 - 17:23
    that is just everywhere. And you can
    manipulate RF by using a device called a
  • 17:23 - 17:28
    radio. And radios can either be harder to
    find where the RF kind of mechanics and
  • 17:28 - 17:33
    the protocol are baked into the silicon
    and are inflexible. Or you can use a
  • 17:33 - 17:37
    software defined radio where you have some
    very general, flexible silicon up front
  • 17:37 - 17:42
    that basically just grab some raw
    information and feeds it to some sort of a
  • 17:42 - 17:44
    processor, which can either be a
    traditional CPU or an FPGA to implement
  • 17:44 - 17:50
    some of the more radio specific things and
    has come a long way in the most most
  • 17:50 - 17:54
    recent few years. And it's now incredibly
    powerful. So we're going to be talking
  • 17:54 - 17:57
    about both harder to find radios and
    tougher to find radios throughout this
  • 17:57 - 18:02
    talk. So if you put together a radio
    coherently, you can start to develop it
  • 18:02 - 18:09
    into a fire. And a fire has a has one main
    component or several components. But one
  • 18:09 - 18:12
    of the main components is this notion of
    the modulation in the modulation is the
  • 18:12 - 18:17
    algorithm that defines how your digital
    values, your bits are mapped into RF
  • 18:17 - 18:22
    energy. And there are a few parameters
    that we can kind of tweak to do that. And
  • 18:22 - 18:25
    those are amplitude frequency and phase.
    And then we can put them together and use
  • 18:25 - 18:30
    some combination of them as well. In
    modulators can modulate either analog or
  • 18:30 - 18:34
    digital information. But we're going to be
    talking about modulating digital
  • 18:34 - 18:39
    information today. And an essential
    concept with that is this notion of a
  • 18:39 - 18:42
    symbol. This is something it's very
    important to remember. And the symbol
  • 18:42 - 18:47
    represents a discrete RF energy state that
    represents some quantity of information.
  • 18:47 - 18:51
    So it's discretely sampled. And just think
    of it as being like a state in your RF
  • 18:51 - 18:57
    medium. That means something. And will
    illustrate this in just a moment. So here
  • 18:57 - 19:00
    we have two pictures of two different
    modulations. And I just want to put these
  • 19:00 - 19:05
    up here to help you maybe get a grasp on
    what a symbol looks like. So on top, we
  • 19:05 - 19:09
    have Frequency King, where you can see
    your signal is alternating between two
  • 19:09 - 19:13
    frequencies. When it's on the left, it's
    swelling on one frequency. When it's on
  • 19:13 - 19:16
    the right, it's dwelling on another
    frequency. Which symbol is present is
  • 19:16 - 19:21
    based on where basically what frequency
    that signal is on at a discretely sampled
  • 19:21 - 19:26
    moment in time. So you could think of this
    as being like, you know, it's a zero when
  • 19:26 - 19:29
    the signal is rolling on the first
    frequency, the one on the left and it's
  • 19:29 - 19:35
    one. And the signal is dwelling on the
    right frequency frequency, too. And you
  • 19:35 - 19:38
    can see the see the analog with the bottom
    modulation off keying where the signal
  • 19:38 - 19:44
    being present represents the one in the
    signal being off represents a zero. So
  • 19:44 - 19:48
    hopefully that helps you get a grasp of
    what it is that we're talking about. There
  • 19:48 - 19:51
    are, of course, more complicated Iot
    fires. We have spread spectrum where data
  • 19:51 - 19:54
    can be basically chipped at a higher rate.
    It'll occupy more spectrum, but it makes
  • 19:54 - 20:00
    it more resilient to noise. And then we
    have some technologies to do that, like
  • 20:00 - 20:05
    eight to 15 for us, one that uses a spread
    spectrum mechanism. So we talked a bit
  • 20:05 - 20:10
    about radios just a moment ago. We're
    going to use two different kinds of radios
  • 20:10 - 20:15
    when when going through this talk. First,
    we have a harder to find radio, which is a
  • 20:15 - 20:18
    microchip. LoRa, are in two, nine and
    three module. And this is basically a
  • 20:18 - 20:25
    death word that has a harder to find lower
    radio built on to it. So this is going to
  • 20:25 - 20:28
    be a transmitter they're going to be
    targeting. And then finally, a receiver is
  • 20:28 - 20:33
    the software defined radio right here.
    This is an ETA USCAP B to ten. It's just a
  • 20:33 - 20:37
    commodity software defined radio board.
    And basically what this thing does is it
  • 20:37 - 20:41
    gets raw RF information from the air,
    serves it to my computer so they can start
  • 20:41 - 20:46
    to work with it. With commodity tools like
    Python, I can do radio, things like that
  • 20:46 - 20:51
    to start to process it. One less thing to
    cover is the fast forward to transform the
  • 20:51 - 20:58
    Esperia transform basically takes a signal
    in decomposes it into all of the the the
  • 20:58 - 21:03
    smaller signals, the some carriers, the
    composite and any periodic signal can be
  • 21:03 - 21:07
    models of some of harmonic sine waves. So
    basically the FFT takes any signal and
  • 21:07 - 21:13
    unravels it into the components. And why
    we care about this is it takes it's
  • 21:13 - 21:18
    basically a very easy way for analyzing
    and visualizing signals in the frequency
  • 21:18 - 21:22
    domain. So when we put it take a bunch of
    50s and put them together, we get this
  • 21:22 - 21:26
    picture called a spectrogram where you
    have time in the the ones we're going to
  • 21:26 - 21:30
    be looking at all the time in the Y axis
    frequency in the Z axis and then sorry,
  • 21:30 - 21:35
    frequency in the X axis and power in the Z
    axis. So the intensity of the color is how
  • 21:35 - 21:39
    how powerful that component is at that
    instant in time. So here you can start to
  • 21:39 - 21:43
    visualize all the different signals that
    are present. OK, raise your hand if you're
  • 21:43 - 21:51
    an expert. I see a few heads. Hopefully
    this is all that we're going to need. I'm
  • 21:51 - 21:54
    going to reiterate some of these concepts
    as we go through. So I really hope that
  • 21:54 - 21:58
    doesn't doesn't alarm you, son. You're
    running for the door. It's going can be
  • 21:58 - 22:02
    very visual as we go through it. And
    hopefully the graphics will help keep this
  • 22:02 - 22:07
    all grounded. So let's get into the meat
    of how this Laurer fireworks. LoRa uses a
  • 22:07 - 22:10
    really neat proprietary fire that's built
    on a modulation called chirp spread
  • 22:10 - 22:17
    spectrum success for short. Now, what is a
    chirp? Chirp is a signal whose frequency
  • 22:17 - 22:21
    continuously increases or decreases. You
    can think of it as being like a sweet
  • 22:21 - 22:27
    tone. And if we visualize it, using a
    spectrogram is before it looks kind of
  • 22:27 - 22:31
    like this. In this case, we have a finite
    amount of bandwidth and the frequency
  • 22:31 - 22:35
    either increases or decreases. You can
    have up chirps or down chirps until it
  • 22:35 - 22:39
    reaches the end of its band. And then it
    wraps around back to the bottom, back to
  • 22:39 - 22:44
    the beginning and continues. So here you
    can see that the frequency that the first
  • 22:44 - 22:48
    derivative of frequency is constant. So
    the frequency is always increasing or
  • 22:48 - 22:51
    decreasing at the same rate. And then when
    it hits the end of the band, it just wraps
  • 22:51 - 22:57
    it keeps going. So why use something like
    success, it has really great it has
  • 22:57 - 23:01
    properties that make it really resilient
    to noise and very performance, low power.
  • 23:01 - 23:05
    So all these things with Iot focused
    radios and having having very long battery
  • 23:05 - 23:10
    life, these are properties that lend
    directly to that sort of efficiency. It's
  • 23:10 - 23:13
    also really resilient to multi path and
    Doppler, which is great for urban and
  • 23:13 - 23:20
    mobile uses. So this is an interesting set
    of sort of features here. Where else do we
  • 23:20 - 23:26
    see chirps radar is. I just heard it.
    Thank you. Yeah. Radar is a really common
  • 23:26 - 23:31
    common usage. And you'll see military
    marine radars sometimes refer to chirps as
  • 23:31 - 23:37
    wide band or pulse compression if they're
    using chirping in the radar scheme. And
  • 23:37 - 23:40
    they're also used for scientific over the
    horizon radars as well. And there's an
  • 23:40 - 23:44
    open source project called the New Chirp
    Sounder that has some some features like
  • 23:44 - 23:49
    that for for visualizing these over the
    horizon scientific radars. And also in a
  • 23:49 - 23:53
    past life, I worked on a scientific radar
    called Super Dhan, which is a similar over
  • 23:53 - 23:59
    the horizon radar for visualizing
    ionospheric activity. Cool. So that's a
  • 23:59 - 24:03
    little bit of background on the technology
    here. So this is kind of my journey into
  • 24:03 - 24:07
    into starting to work with LoRa here. In
    December. Twenty fifteen, I joined this
  • 24:07 - 24:11
    company, Bestilo, where I'm currently. And
    on the research team we have these weekly
  • 24:11 - 24:15
    meetings where we get together and we look
    at new either new R.F. techniques or
  • 24:15 - 24:17
    protocols, things that are interesting.
    And we basically just have a deep
  • 24:17 - 24:22
    brainstorm on how they work. And and
    what's interesting and the first meeting
  • 24:22 - 24:25
    that I participated in, it was the first
    week that I joined. They were mentioning
  • 24:25 - 24:29
    they were talking about these L.P
    technologies. They sounded pretty cool. So
  • 24:29 - 24:35
    we broke for Christmas. So I went back to
    to New York where I'm from, and, you know,
  • 24:35 - 24:40
    brought my radio and sort of poking around
    and seeing what I could find. And my
  • 24:40 - 24:44
    colleagues looked in San Francisco,
    Atlanta, and I also worked in Boston. I
  • 24:44 - 24:48
    was there, too. And we didn't see LoRa
    anywhere in December. Fortunately, a few
  • 24:48 - 24:54
    weeks later, I was I was at a meetup and I
    encountered this company, Senate. I was
  • 24:54 - 24:57
    living in Cambridge, Massachusetts, at the
    time. And they were talking about their
  • 24:57 - 25:01
    their home heating oil monitoring network
    sounded pretty cool. So I looked him up
  • 25:01 - 25:05
    later and was watching one of the
    marketing videos. And there was like a two
  • 25:05 - 25:09
    or three second bit where you could see
    one of their technicians operating a
  • 25:09 - 25:12
    computer. Right. And they put up this
    picture and this looks just like a
  • 25:12 - 25:17
    coverage map. Right. So, you know, this
    could be fake data or it could be live.
  • 25:17 - 25:23
    And I took a bit of a closer look and I
    realized where that is. That's Portsmouth,
  • 25:23 - 25:26
    New Hampshire. That's like an hour away
    from Boston. So there's really only one
  • 25:26 - 25:33
    thing to do. So I hop in my car, I drive
    up to New Hampshire, to Maine border, and
  • 25:33 - 25:40
    there's, you know, me behind the wheel, my
    Saab with the USPI on the dash. And after
  • 25:40 - 25:43
    about ten minutes in the Marriott parking
    lot across the street from there from
  • 25:43 - 25:47
    their headquarters, we have our first
    sighting of LoRa in the wild. There it is.
  • 25:47 - 25:53
    It's the first signal I recorded. So let's
    take a closer look at what we have here.
  • 25:53 - 25:56
    So if we look at the top third of the
    picture, we have a series of repeated up
  • 25:56 - 25:59
    trips. You can see the signal is just
    continuously increasing until it hits the
  • 25:59 - 26:04
    band and then it wraps and continues. And
    knowing what we know about digital
  • 26:04 - 26:08
    communication systems, most of them have
    some notion of a preamble or training
  • 26:08 - 26:12
    sequence to tell a receiver that, hey,
    heads up, you're about to get a packet. So
  • 26:12 - 26:16
    probably with that is following that, you
    can see the chip direction changes right
  • 26:16 - 26:20
    in the middle and you have two and a
    quarter downtowners. And this looks like a
  • 26:20 - 26:24
    start, a frame delimiter or a
    synchronization element. So this tells the
  • 26:24 - 26:28
    receiver, hey, heads up, preambles over.
    You're about to get you're about to get
  • 26:28 - 26:32
    the data. You're about to get get the
    payload here. And finally, you can see the
  • 26:32 - 26:37
    chip direction again, changes to the up
    chirps. But this time the chirps are kind
  • 26:37 - 26:41
    of choppy. You see, they jump around
    throughout the band, you know, just kind
  • 26:41 - 26:45
    of arbitrarily. It's not arbitrary,
    though. That's actually the data being
  • 26:45 - 26:51
    encoded into the fire. So here we can see
    that the chirp frequency, that is the
  • 26:51 - 26:54
    first derivative of the frequency, the
    rate at which the frequency changes
  • 26:54 - 26:59
    remains constant. Right. However, the
    instantaneous frequency may change within
  • 26:59 - 27:02
    the band. So you may have these jumps, but
    remember that the rate at which it's
  • 27:02 - 27:08
    changing is always constant. You can just
    have those discontinuities in those
  • 27:08 - 27:14
    instantaneous frequency changes represent
    data being modulated onto the chirps. You
  • 27:14 - 27:17
    can kind of think of this as being like a
    frequency modulated chirp with an FM
  • 27:17 - 27:22
    signal. You have a static carrier, a
    carrier at a fixed frequency that you're
  • 27:22 - 27:27
    modulating to produce that signal. The
    modulated signal here we're modulating a
  • 27:27 - 27:31
    chirp signal to produce the to produce
    that. So rather than having a fixed
  • 27:31 - 27:37
    frequency that you're modulating your
    modulating this continuous chirp. Cool. So
  • 27:37 - 27:39
    let's get our hands dirty. Let's figure
    out how this thing works and start to pull
  • 27:39 - 27:44
    some data out of it before we dove into
    the modulating it, let's take a look at
  • 27:44 - 27:48
    what we know through some open source
    intelligence. And using open source
  • 27:48 - 27:52
    intelligence is a great way to really kind
    of shortcut the reverse engineering
  • 27:52 - 27:56
    process. Because otherwise, you can you
    can wind up doing a lot more work than you
  • 27:56 - 28:00
    have to. So there are a few things that
    are really useful. We'll talk about these
  • 28:00 - 28:05
    as we go through this. This material first
    thing we found. First thing I found was
  • 28:05 - 28:10
    the Simsek European patent application. It
    was in the EU market, but basically
  • 28:10 - 28:16
    defined it modulation. That looked a lot
    like what Lura could be. That's the number
  • 28:16 - 28:18
    if you want to look it up later. But that
    had some pretty good information in their
  • 28:18 - 28:25
    final year. Secondly, we have the law of
    the law when spek. And again, that's the
  • 28:25 - 28:30
    layer to add up spec that's open, not the
    PHY, but it still has some references and
  • 28:30 - 28:34
    define some terms that are likely going to
    be analogous to the file. So it's still
  • 28:34 - 28:37
    pretty useful. And finally, we have two
    application notes from some tech that were
  • 28:37 - 28:43
    pretty juicy. The first one and there are
    the the 18 one contained a number of
  • 28:43 - 28:46
    reference algorithms for implementing a
    whitening sequence, which is like a
  • 28:46 - 28:52
    scrambler. We'll talk through that or
    we'll talk about that momentarily. And
  • 28:52 - 28:57
    then twenty two had just a general
    overview of the fine, define some terms.
  • 28:57 - 29:03
    Also, there was some prior art online.
    There was a partial implementation in RTL
  • 29:03 - 29:08
    Strangelove that didn't really seem to be
    maintained. It seemed pretty neglected and
  • 29:08 - 29:13
    I never really got it to to do anything at
    all. But we're still good to look at and
  • 29:13 - 29:16
    had some really good hints in there. And
    then there were also some very high level
  • 29:16 - 29:22
    observations in the FI in this wiki page
    based an else decoding LoRa. It was mostly
  • 29:22 - 29:26
    just like looking at the spectrum and
    seeing that it's a chirp modulation and
  • 29:26 - 29:30
    example recordings and things like that.
    So from this documentation, we can start
  • 29:30 - 29:35
    to pull out some definitions defined. We
    have the bandwidth, which is how much
  • 29:35 - 29:39
    spectrum the chirp can occupy, the
    spreading factor, which is the number of
  • 29:39 - 29:44
    bits encoded symbol. And remember, the
    symbol is it's just an RF state rights,
  • 29:44 - 29:49
    the number of bits in each RF state within
    the modulation. And then finally we have
  • 29:49 - 29:52
    this thing called the chirp rate, which
    we've kind of hinted at. It's the first
  • 29:52 - 29:57
    derivative of the chirp frequency. So the
    rate at which that that chirp signal is is
  • 29:57 - 30:01
    constantly changing. And we can pull some
    numbers out of this documentation to
  • 30:01 - 30:05
    define those. So we actually have have
    some common constants for the first two.
  • 30:05 - 30:10
    And then we find a formula in one of those
    documentations that states the rate is a
  • 30:10 - 30:16
    function of those first two. And since
    there's a finite number of values there,
  • 30:16 - 30:20
    we can start to iterate and just try all
    the different frequencies and start to
  • 30:20 - 30:26
    find one that that works. So in this case,
    what is the symbol we've talked about how
  • 30:26 - 30:31
    how this modulation is basically frequency
    modulated chirps. Right. So what we're
  • 30:31 - 30:35
    going to try to do with these demodulator
    is quantify exactly where the chirp jumps
  • 30:35 - 30:40
    to whenever we have one of those
    discontinuities. So let's start working
  • 30:40 - 30:43
    through it here. There are really three
    steps we're going to we're going to
  • 30:43 - 30:45
    achieve. We're going to identify the
    preamble, which is the beginning of the
  • 30:45 - 30:50
    frame denoted with the one we're going to
    find the start of that of the FI data unit
  • 30:50 - 30:53
    by look, by looking in, synchronizing
    against the sink word, which are those
  • 30:53 - 30:57
    downshifts that are there. And then
    finally, step three is we're going to try
  • 30:57 - 31:00
    to figure out how to extract the data from
    these instantaneous frequency transitions.
  • 31:00 - 31:05
    And to do that, we need to quantify them.
    Now, there's a technique that I found
  • 31:05 - 31:09
    pretty early on. It was enormously helpful
    for doing this, and that is to transform
  • 31:09 - 31:13
    the signal by describing it. And we'll
    show you what the result is in just a
  • 31:13 - 31:17
    moment. But first, we're going to have to
    do some math. And math doesn't read
  • 31:17 - 31:23
    because it's scary, but it's it's not
    really it's actually pretty easy. So
  • 31:23 - 31:25
    there's a basic basic property of complex
    signals that states that if you multiply
  • 31:25 - 31:31
    two signals together, if you multiply two
    signals together, the resulting signal has
  • 31:31 - 31:36
    the frequency of the frequency of each of
    the components added together. And from
  • 31:36 - 31:41
    that, if we multiply a signal with one
    frequency against the signal that has the
  • 31:41 - 31:45
    negative value of its frequency, the
    result is zero. We get a deep we get a
  • 31:45 - 31:49
    constant signal and we're working at
    baseband here, which means the center of
  • 31:49 - 31:54
    the band is zero hertz so we can see
    negative frequencies and things like that.
  • 31:54 - 31:59
    So if you multiply an up and down chirp
    together, what do you get? You get
  • 31:59 - 32:04
    constant frequency. Now why do I say
    constant frequency rather than DC? If the
  • 32:04 - 32:07
    troops are out of phase with one another,
    there might be an offset from from zero
  • 32:07 - 32:12
    hertz there. So so it might not be
    perfectly aligned with zero hertz. We
  • 32:12 - 32:17
    might do expect to get some offset there.
    So what happens if you multiply a chirp
  • 32:17 - 32:21
    signal like this separately against an up
    chirp and it down chirp. So to do
  • 32:21 - 32:25
    different two different operations
    produced two different products. What do
  • 32:25 - 32:29
    you think is going to happen? Well, if you
    do that, you get these pretty pictures
  • 32:29 - 32:33
    right here, so here you can see those
    those there's really kind of tricky
  • 32:33 - 32:37
    diagonal chirp signals that are cutting
    all of your spectrum, are hard to measure,
  • 32:37 - 32:43
    are translated into these nice, you know,
    nice signals that are aligned in time. And
  • 32:43 - 32:47
    that looks like something we can start to
    really work with and do something with. So
  • 32:47 - 32:50
    we need to quantify those. So, again,
    remember symbols, we're going to keep
  • 32:50 - 32:53
    coming back to this. It's an hour of
    state. The results represent some number
  • 32:53 - 33:00
    of bits and the law, LoRa, has this value
    called the spreading factor that we found
  • 33:00 - 33:04
    some of the documentation that defines the
    number of bits encoded for symbol. And
  • 33:04 - 33:07
    from the picture we saw a little bit
    earlier, the common values are seven
  • 33:07 - 33:14
    through 12 or six or 12. You see you see
    them both in different markets. So from
  • 33:14 - 33:18
    that, how many possible symbols to be
    expressed? There can be? Well, each bit
  • 33:18 - 33:23
    can have, you know, two states is your
    one. And there are spreading factor number
  • 33:23 - 33:28
    of bits. The number of symbols is two to
    the spreading factor. So how can we start
  • 33:28 - 33:33
    to quantify these these symbols and start
    to pull them out of the fire? So the steps
  • 33:33 - 33:36
    that I found that were that were the trick
    to this were to channelize and resample
  • 33:36 - 33:42
    the signal to the bandwidth, decrypt the
    signal with the look of the signal with a
  • 33:42 - 33:46
    locally generated chirp we just talked
    about. Then we're going to take a fast
  • 33:46 - 33:51
    Fauria transform that signal where the
    number of bends of the 50 that we compute
  • 33:51 - 33:55
    is equal to the number of possible
    symbols. And we'll illustrate this
  • 33:55 - 33:59
    momentarily. And then if we do that
    correctly, then the most powerful
  • 33:59 - 34:03
    component in that Pesquería transform,
    that is the strongest component frequency
  • 34:03 - 34:07
    that we get back from that operation is
    the symbol that we're looking for,
  • 34:07 - 34:10
    somebody chirping it. We get it into a
    form where we really expect her to only be
  • 34:10 - 34:16
    one strong component per FFT, whereas if
    we didn't ditch it when we took the 50 of
  • 34:16 - 34:20
    of a chirps worth of symbols, we would see
    the energy kind of spread all throughout,
  • 34:20 - 34:23
    all throughout all the different bits. But
    by describing it correctly, all that
  • 34:23 - 34:30
    energy gets pushed into one bin and we get
    a single but clear value out of it. So if
  • 34:30 - 34:33
    we do that, we get a picture that looks
    like this in here at the Z axis again, is
  • 34:33 - 34:38
    the is the intensity, the power present.
    And we expect that to be the symbol that
  • 34:38 - 34:42
    we're looking for. And here it's aligned
    in time with the base chip on the left
  • 34:42 - 34:48
    there. So here are the steps again. We
    mentioned this earlier. Let's look for the
  • 34:48 - 34:54
    for the preamble. Right. What's a stupid,
    simple algorithm for finding this? Let's
  • 34:54 - 34:58
    do it. Let's do it at 50 and let's look
    for basically the most powerful component
  • 34:58 - 35:03
    being in the same bin for some number of
    consecutive Fatty's easy fighting. The SFD
  • 35:03 - 35:07
    is the same thing. But again, this time
    we're going to do it on the opposite
  • 35:07 - 35:12
    ditcher product. So when we did it, we get
    back to different streams. We get one of
  • 35:12 - 35:17
    the D chirped up, chirps in one of the D
    chirp downstairs so we can look at the
  • 35:17 - 35:25
    opposite stream and do the same algorithm
    looking for the the safety here. Important
  • 35:25 - 35:28
    caveat. Accurately synchronizing on the
    Safdie is essential for getting good, good
  • 35:28 - 35:33
    data out of this, this modulation, because
    if you have a bad sync then you can wind
  • 35:33 - 35:37
    up having your bisley, your symbols, the
    samples that comprise your symbol spread
  • 35:37 - 35:42
    between multiple adjacent fêtes if that
    happens and you get incorrect data. Now
  • 35:42 - 35:46
    let's illustrate what that looks like. If
    you look at rows thirty nine fifty, you
  • 35:46 - 35:49
    can see that visually it's almost
    impossible to tell which of those two
  • 35:49 - 35:52
    readings represents the symbol. You see,
    there are two different values that are
  • 35:52 - 35:57
    really powerful. That's the result of
    basically basically half of the samples
  • 35:57 - 36:01
    from one chirp and basically half of the
    sample from Chirp N and then half of the
  • 36:01 - 36:06
    samples from sample from chirp end plus
    one wind up in the same FFT. So when we do
  • 36:06 - 36:08
    it, we get those two components in there.
    And it's really it's really ugly and hard
  • 36:08 - 36:14
    to work with. So we can solve this by
    using a technique called overlapping
  • 36:14 - 36:18
    Mufti's when looking for our safety
    synchronization. And basically what that
  • 36:18 - 36:22
    means is we're going to process each
    sample multiple times with the effect of
  • 36:22 - 36:27
    getting better resolution in time of our
    resulting Mufti's. It's more
  • 36:27 - 36:32
    computationally intensive, but it gets us
    much better, better fidelity here. So if
  • 36:32 - 36:35
    we do that, this is what the result looks
    like. It's a little bit hard to see right
  • 36:35 - 36:39
    now. I'll get you a better picture in a
    moment, but basically it's much less
  • 36:39 - 36:44
    ambiguous in terms of which symbol is
    present. So if we use those overlapping
  • 36:44 - 36:49
    50s, we can synchronize on that SFD. And
    then once we know exactly where the first
  • 36:49 - 36:53
    symbol of the data unit is and our buffer,
    we can go back to using non overlapping
  • 36:53 - 36:58
    Mufti's, which are more computationally
    more computationally efficient. And get us
  • 36:58 - 37:02
    a nice read on the right here. You can see
    that again, if we look at lines thirty
  • 37:02 - 37:06
    eight and thirty nine, that ambiguity is
    gone. Right. You can see exactly where the
  • 37:06 - 37:09
    most intensive were, the most intense
    binnaz and therefore which symbol is
  • 37:09 - 37:13
    present. And here's the whole frame
    synchronized. So we got the collisions on
  • 37:13 - 37:19
    the left and doesn't look that great on
    the right it's much clearer. Cool. So
  • 37:19 - 37:23
    again we recompute more computationally
    intensive and then we get out data. Now,
  • 37:23 - 37:28
    one last thing we have to do to wrap up
    the modulation. So doing this again,
  • 37:28 - 37:32
    remember, we were talking about the
    chermayeff, if our troops aren't perfectly
  • 37:32 - 37:37
    aligned, then then the resulting
    deterrence signal might not necessarily be
  • 37:37 - 37:40
    off of the same reference. Right. And of
    course, we don't know what chirp was used
  • 37:40 - 37:45
    to generate the signal on the transmitter.
    So we have to find some way of normalizing
  • 37:45 - 37:50
    this data to account for that that that
    first discrepancy. And we can do that by
  • 37:50 - 37:53
    referencing the preamble. And it just so
    happens that the preamble, when you do it,
  • 37:53 - 37:57
    always represents simple value zero. So
    you can basically just do a modulo
  • 37:57 - 38:00
    operation on your receive symbols to
    rotate that back. So all the symbols are
  • 38:00 - 38:05
    referenced off of the preamble and you're
    good to go. And that's it, right. Not even
  • 38:05 - 38:11
    close. We're just getting started, people.
    Why is that? Because the data here is
  • 38:11 - 38:15
    encoded. What is encoding? Basically
    encoding is a transformation that is
  • 38:15 - 38:19
    applied to the data before it's
    transmitted. Why would you do something
  • 38:19 - 38:25
    like that? Because encoding increases over
    the year. Resiliency. Why? Why is this
  • 38:25 - 38:30
    necessary? Right. Remember that we're
    dealing with unlicensed spectrum. Right.
  • 38:30 - 38:32
    This is what the nine hundred megahertz
    band, which is what LoRa uses in the
  • 38:32 - 38:37
    United States, looks looks like look at
    all that stuff. It's not LoRa, right? That
  • 38:37 - 38:40
    stuff is there to ruin your day. It's
    there to create all sorts of interference
  • 38:40 - 38:44
    and make your receiver not work the way
    you expect. So RF is a really brutal
  • 38:44 - 38:47
    environment. There's all sorts of
    interference. And basically the encoding
  • 38:47 - 38:51
    is a way of treating your data so that
    even if you have a non ideal reception,
  • 38:51 - 38:56
    you can still get the data out of the
    frame. So what do we have here? Remember
  • 38:56 - 38:59
    that LoRa's clotheshorse, we have some
    material that's available through data
  • 38:59 - 39:03
    sheets, but we really don't know for sure
    definitively what's in this file. So,
  • 39:03 - 39:07
    again, we're going to go back to open
    source intelligence to figure out what we
  • 39:07 - 39:10
    know and then try to narrow in on how
    we're going to iterate through this and
  • 39:10 - 39:15
    figure out how it works. So from the
    patent, we have a number of very good
  • 39:15 - 39:21
    clues. First of all, it refers to the
    stage called gray indexing, which, as is
  • 39:21 - 39:24
    defined there should add zero tolerance.
    In the event that you read, a symbol is
  • 39:24 - 39:29
    being off by one, off by one bit. But if
    you if you read a symbol in the incorrect,
  • 39:29 - 39:33
    then secondly, you have data whitening,
    which induces randomness into the frame.
  • 39:33 - 39:37
    We'll talk about that momentarily. If
    interleaving, which scrambles the bits
  • 39:37 - 39:42
    within the frame, then you have for error
    correction, which adds correcting parody
  • 39:42 - 39:45
    bits, you can think of it as being a
    parody bits on steroids rather than
  • 39:45 - 39:48
    telling you that just an error occurred.
    It can actually help you correct the error
  • 39:48 - 39:53
    without needing retransmit. So we have
    four different things to that to comprise
  • 39:53 - 40:01
    the encoding there in the patent. Right.
    So that's awesome. It's easy, right? Why
  • 40:01 - 40:12
    is that? Because documentation lies to us
    and even. And even even the clear, even
  • 40:12 - 40:19
    the clearest signals can can can lead us
    into dead ends. So let me show you how. So
  • 40:19 - 40:23
    the grand hexing we read to represent
    great cotting, which is just a basic
  • 40:23 - 40:28
    binary transformation that you can use to
    treat data whitening. We actually have
  • 40:28 - 40:31
    defined in one of the application notes
    reference designs for the pseudo random
  • 40:31 - 40:35
    number generators that you use for use of
    the whitening. It's like C-code that you
  • 40:35 - 40:41
    can copy and paste. So this should be like
    this should be rock solid. Step three, we
  • 40:41 - 40:46
    have an actual algorithm for the EarlyBird
    that is defined in the patent. I'll show
  • 40:46 - 40:52
    you what it is momentarily. And then
    finally, step four suggests that having a
  • 40:52 - 40:56
    human code is used, which is just a
    standard for error correction mechanism.
  • 40:56 - 41:01
    So the first thing to focus on figuring
    out here is the data whitening. And that's
  • 41:01 - 41:04
    a critical step because this is the way
    the whitening works, is you X or your
  • 41:04 - 41:08
    message against a random string. And
    unless you know what the random string is,
  • 41:08 - 41:13
    you're not going to be able to make any
    sense of what follows it. So figuring out
  • 41:13 - 41:16
    that random string is essential to being
    able to even make sense of what follows
  • 41:16 - 41:21
    it. So, again, with whitening, you take
    your you take your your buffer that's
  • 41:21 - 41:24
    going out to the radio and you exhort
    against a pre computed sort of random
  • 41:24 - 41:29
    string that is known to both the
    transmitter and the receiver. Then when
  • 41:29 - 41:33
    the receiver gets in the frame, it
    explores that the received buffer against
  • 41:33 - 41:36
    the same sequence that the transmitter
    used. And you get back to the original
  • 41:36 - 41:40
    data because if you remember, explores its
    own inverse. So that nicely undoes itself.
  • 41:40 - 41:45
    Now, why would we bother with whitening,
    and that's because having random data is
  • 41:45 - 41:50
    really good for receivers similar to
    Manchester and coding, where basically by
  • 41:50 - 41:54
    by encoding the data such that you don't
    have some number of consecutive values of
  • 41:54 - 41:58
    some number of consecutive symbols of the
    same value. You get this nice random data
  • 41:58 - 42:02
    source. What that does is creates lots of
    edges for your receiver to do clock
  • 42:02 - 42:06
    recovery against so you get better
    reception of longer messages or if your
  • 42:06 - 42:10
    clocks are bad. Manchester, of course,
    comes with the penalty of a reduced bit
  • 42:10 - 42:15
    rate. It actually cuts the effective bit
    rate that you can use into half of the
  • 42:15 - 42:18
    battery was whitening, does not. The
    caveat is that you have to know what the
  • 42:18 - 42:24
    string is in order for it to work. So
    let's find the waiting sequence. We've got
  • 42:24 - 42:28
    these algorithms in the in the application
    note, we've got some examples and strange
  • 42:28 - 42:35
    love. None of them worked, so we had to
    figure this out empirically. How can we do
  • 42:35 - 42:39
    that when there's interleaving and for
    error correction in in the in the pipeline
  • 42:39 - 42:43
    here? Right. You know, we can we can send
    something that might, you know, put the
  • 42:43 - 42:48
    whitening in a certain state that we could
    we could leverage. Right. But we still
  • 42:48 - 42:50
    have these unknown transforms and follow
    it. How are we going to be able to figure
  • 42:50 - 42:53
    out what what goes up? How are we going be
    able to figure out the whitening when
  • 42:53 - 42:57
    those operations are in the loop, too?
    Well, we need to bound the problem and
  • 42:57 - 43:02
    make some assumptions that we can start to
    iterate through this black box problem. So
  • 43:02 - 43:05
    we're going to assume that the Forder
    correction is what the documentation tells
  • 43:05 - 43:10
    us. It is the Heming and for and we're
    also going to make another assumption and
  • 43:10 - 43:15
    we're going to set the spreading factor
    equal to eight bits per symbol. And
  • 43:15 - 43:18
    basically, if you do that, then it makes
    it such that we'll have exactly one
  • 43:18 - 43:25
    Heming, eight four code word per eight
    bits per symbol, because if we set the
  • 43:25 - 43:29
    number of total bits in our having error
    correcting code to eight, if it's
  • 43:29 - 43:33
    possible, fits very nicely and should work
    out well. Now there's another very useful
  • 43:33 - 43:35
    property of the Hemingford Error
    correcting code scheme that we're also
  • 43:35 - 43:41
    going to exploit, and that's that Heming
    eight for contains four data bits and four
  • 43:41 - 43:48
    parity bits each. And for 14 of those 16
    states, again, remember two possible
  • 43:48 - 43:55
    states per bit to the power for data bits
    per code word in each of those in 14 of
  • 43:55 - 44:01
    those 16 code word possibilities, other
    for ones and for zeroes each. However, for
  • 44:01 - 44:06
    the four, the word for data Knebel zero.
    That's four zeros. The code word of that
  • 44:06 - 44:12
    is eight zeros. So it's totally non
    additive. So if we if we send our error
  • 44:12 - 44:17
    correcting scheme a string of zeros to
    apply itself to, it's totally not
  • 44:17 - 44:22
    additive. We get back twice as many zeros
    so we can leverage that to do something to
  • 44:22 - 44:25
    try to cancel out that for error
    correcting stage. So let's go ahead and
  • 44:25 - 44:30
    transmit a string of zeros. Right. So,
    again, if it's hamming it for his resume,
  • 44:30 - 44:36
    we expect that stage for the four year
    curtain code to cancel out, right. What
  • 44:36 - 44:39
    about the inner lever? Let's take a look
    at the algorithm that suggested in the
  • 44:39 - 44:44
    pattern. There it is. The key takeaway
    from this is if this is implemented in a
  • 44:44 - 44:49
    way that's similar to this, is this should
    be totally non additive. So this should
  • 44:49 - 44:54
    just move bits around but not add any
    bits. Right. So if it is in fact non
  • 44:54 - 44:59
    additive and all we pass through are a
    bunch of zeros, what happens when you
  • 44:59 - 45:02
    shuffle around a bunch of zeros? You get
    the same thing out, so that falls away,
  • 45:02 - 45:07
    too, right? So we're left with two states,
    right? We have our symbol grand stage and
  • 45:07 - 45:12
    our data waiting stage waiting is what
    we're solving for. That's our variable and
  • 45:12 - 45:16
    gray indexing. The quote unquote indexing
    is a bit of an ambiguous term, but it
  • 45:16 - 45:22
    likely refers to some variant of gray
    coating, which we mentioned earlier. But
  • 45:22 - 45:26
    even if it is gray coating versus gray
    coating or nothing at all, it's just
  • 45:26 - 45:30
    something they didn't implement. That
    leaves only three permutations here.
  • 45:30 - 45:32
    Right. So we've just reduced all the
    ambiguity of figuring out what this
  • 45:32 - 45:36
    decoder is to really figure out what the
    lighting sequences, to really just
  • 45:36 - 45:41
    figuring out which of the three states
    this for which of the three operations,
  • 45:41 - 45:47
    this first gray indexing stages. Right. So
    if we do that, we try all three. That's
  • 45:47 - 45:50
    only three things to attempt in order to
    derive the whitening sequence from the
  • 45:50 - 45:53
    transmitter, because, again, if we send
    through a string of zeros, what is the
  • 45:53 - 45:59
    whitening do? It explores the zeroes
    against the pseudo random string and what
  • 45:59 - 46:04
    does anything extra zero. It's the input.
    So we can do this and get the transmitter
  • 46:04 - 46:08
    to tell us what its whitening sequences so
    we can implement the receiver, read that
  • 46:08 - 46:13
    out, plug it back in and then start to
    sell for the rest. Cool. Next stage is the
  • 46:13 - 46:17
    inner lever. Again, we had that formula
    from the patent surprise surprise
  • 46:17 - 46:22
    implemented. It was no good. So let's
    figure out how this works now. We're going
  • 46:22 - 46:29
    to move very quickly through this because
    this was the hardest part of all this. And
  • 46:29 - 46:32
    I'm going to show you the process without
    making us all the time of staring at a
  • 46:32 - 46:38
    bunch of graph paper and trying things
    that that kind of went into this. But
  • 46:38 - 46:40
    again, just like with the whitening
    sequence, we're going to exploit
  • 46:40 - 46:45
    properties of the Heming fact, reveal
    patterns in the interleave. So, again, if
  • 46:45 - 46:47
    we look at our Heming eight for code words
    that we know and love that are very
  • 46:47 - 46:53
    useful, we're going to use this time the
    code word for for once, the code word for
  • 46:53 - 46:59
    for Hex F, and in that case, the state of
    that code word is eight once. So if we
  • 46:59 - 47:03
    construct a bunch of packets, we're
    basically we take we take eight symbols.
  • 47:03 - 47:10
    We start we take we take four four bytes,
    which is eight symbols and SFH and we walk
  • 47:10 - 47:15
    the position of those ones through our our
    frame here. We can start to look for
  • 47:15 - 47:24
    patterns. Who sees it. I'll save you the
    trouble. Who sees it. Now look at the the
  • 47:24 - 47:27
    bottom row. Second from the right and
    you'll see the pattern. Basically it's a
  • 47:27 - 47:33
    diagonal inner lever. But the first two,
    the two most significant bits are flipped.
  • 47:33 - 47:36
    So if we take this and then read out,
    basically we can take this and we can
  • 47:36 - 47:42
    start to map those diagonal positions into
    positions within within a interleave
  • 47:42 - 47:47
    matrix. So if we do that, we walk through
    all the different states and map those
  • 47:47 - 47:53
    positions out with data that we know we
    get this nice table. Now, let's put this
  • 47:53 - 47:57
    table next to the data that we're looking
    for. Right. So here we decomposed the
  • 47:57 - 48:01
    Heming code words for for the data we in,
    which is, of course, our beloved dead beef
  • 48:01 - 48:08
    on the in the middle column. On the left,
    we have the the data values, the four data
  • 48:08 - 48:14
    bits that we're looking for. And then the
    column, the right column on the left there
  • 48:14 - 48:18
    is are the Perati bits that we're looking
    for. Again, I'm going to make this easy
  • 48:18 - 48:21
    for you. If you stare at this for long
    enough, you become compelled to reverse
  • 48:21 - 48:26
    the order. And then if you continue
    staring at it, you start to see some
  • 48:26 - 48:30
    patterns. That looks like our data, right.
    So if we go a step further, we can start
  • 48:30 - 48:36
    to map in some of these HanTing correcting
    fields into this this matrix here. So here
  • 48:36 - 48:41
    we see the four data are the rightmost
    rightmost bits. And then we can see that
  • 48:41 - 48:45
    Perati bits, one and two correlate very
    nicely. And if you go a step further, we
  • 48:45 - 48:52
    can see that. These are these the Ghiz
    five in format very closely as well,
  • 48:52 - 48:56
    although they're flipped, you'll see that
    Perati before is actually more significant
  • 48:56 - 49:00
    period of three. So we're almost there,
    right. Although we have left to do is
  • 49:00 - 49:06
    applier and we're done. And that's the
    modulation. That's the whole thing. So,
  • 49:06 - 49:18
    again, let's thank you. So, again, let's
    let's talk briefly about these red
  • 49:18 - 49:23
    herrings and try to wrap this up, I want
    to do a demo before our Q&A. So we had
  • 49:23 - 49:26
    these four different encoding stages here,
    right? We had great documentation for all
  • 49:26 - 49:29
    of them. But empirically, after
    implementing them, we were able to
  • 49:29 - 49:36
    establish that, well, three of the three
    of the four just weren't the case. Right.
  • 49:36 - 49:40
    One of them was actually cool, right? One
    of them was actually what it said it was.
  • 49:40 - 49:44
    So. So, yeah. Anyway, how are we able to
    work through this? I think it's important
  • 49:44 - 49:48
    to reflect and try to get some takeaways
    from this. Hopefully this is useful as you
  • 49:48 - 49:52
    approach your reverse engineering
    challenges. Basically, what was essential
  • 49:52 - 49:55
    here was being able to bauen the problem
    and hold certain things constants that we
  • 49:55 - 49:59
    could solve for unknowns. And if you
    remember, we kind of did this in two
  • 49:59 - 50:03
    stages. We were able to cancel out the
    interleaving in the forward error
  • 50:03 - 50:08
    correction and hold that hold that
    standard, hold that static in order to
  • 50:08 - 50:12
    figure out the whitening sequence. And the
    gray indexing were kind of all in one go.
  • 50:12 - 50:15
    And then when we controlled the grand
    indexing, the whitening sequence, and
  • 50:15 - 50:19
    we're pretty confident about what the Ford
    error correction was, there was really
  • 50:19 - 50:24
    only one variable that we really had to
    had to solve, really only one thing. We
  • 50:24 - 50:26
    actually had to go into the bits and
    really, really kind of dig out of this
  • 50:26 - 50:31
    thing. Right. So by making these
    assumptions, using open source information
  • 50:31 - 50:35
    and really bounding the problem and
    working, working through it, through it,
  • 50:35 - 50:39
    coherently able to reverse these four
    stages down into really one experimental
  • 50:39 - 50:45
    variable and just solve for it. So that's
    that's really the trick here. OK, I'm
  • 50:45 - 50:49
    going to blow through this next part to
    talk very briefly about the structure, the
  • 50:49 - 50:54
    Laurer Phi Phi packett. So this is a
    picture pulled out of one of the one of
  • 50:54 - 51:00
    the data sheets. We already talked about
    the preamble, this repeated chirps. One
  • 51:00 - 51:03
    thing that's not pictured here is the
    single word in the story frame delimiter,
  • 51:03 - 51:09
    which is right there. And then we have
    this thing called the header. Right. And
  • 51:09 - 51:12
    it says here that the header is only
    present in explicit mode. So there's this
  • 51:12 - 51:17
    notion of implicit versus explicit header
    in LoRa. And the explicit header includes
  • 51:17 - 51:21
    a finder that that has some information,
    such as the length of the payload, the
  • 51:21 - 51:26
    type of scheme in there that's applied to
    the remainder of the payload, not the
  • 51:26 - 51:30
    header itself, but the rest of it. And
    then there's also an optional CRC as well.
  • 51:30 - 51:34
    It can be included in implicit assumes
    that the receiver knows the modulation
  • 51:34 - 51:41
    parameters and skips that bit. So no
    problem, right? We can use implicit mode
  • 51:41 - 51:46
    to figure out what the whitening sequences
    and then switch back to explicit mode, use
  • 51:46 - 51:49
    the whitening sequence from implicit and
    figure out what the header is by just
  • 51:49 - 51:54
    looking to see what the values are as we
    change the modulation. Yeah, right. None
  • 51:54 - 52:00
    of this is easy, right? Like, really,
    really nothing. Nothing helps us here. So
  • 52:00 - 52:04
    as it turns out, implicit and explicit
    explicit header modes use different
  • 52:04 - 52:08
    whitening sequences. So the header remains
    unpersuaded, even if we know what the
  • 52:08 - 52:12
    implicit whitening sequence is implicit
    about whitening sequences. So let's see
  • 52:12 - 52:17
    what we know. Again, we've got this header
    here and in this picture tells us the code
  • 52:17 - 52:21
    rate is always four eight for the header.
    So no matter what the code rate, that is
  • 52:21 - 52:25
    the the number of bits in the Heming for
    Hemingford error correcting codes used is
  • 52:25 - 52:30
    for the rest of the packet. This code red
    is always for it. Well, what about the
  • 52:30 - 52:36
    spreading factor, as it turns out, the
    header is always sent at the spreading
  • 52:36 - 52:40
    factor, that is to less than the rest of
    your modulation, the code rate is still
  • 52:40 - 52:44
    for the spreading factor for the header is
    the pretty factor of minus two. So two
  • 52:44 - 52:48
    fewer bits per symbol, even if the headers
    implicit and I have to credit Thomas tell
  • 52:48 - 52:52
    Camp for giving me the tip that actually
    led led to kind of putting this all
  • 52:52 - 52:57
    together thanks to him. So again, the
    first eight symbols, no matter whether
  • 52:57 - 53:01
    you're an implicit or explicit mode, are
    always Senate it minus two and code word
  • 53:01 - 53:06
    for it. That's always the case. Also,
    there's this mode called low data rate
  • 53:06 - 53:10
    where if that set on, then all of the
    symbols in the remaining in the remainder
  • 53:10 - 53:17
    of the five, the five packet are also sent
    at spreading factor F minus two. So it's
  • 53:17 - 53:19
    just an extra basically gets you some
    extra margin in case you're dealing with
  • 53:19 - 53:24
    the noisy channel and need to get data for
    that's the five who want some tools to go
  • 53:24 - 53:29
    with it, who's curious about this and
    wants to start playing with it. Does LoRa
  • 53:29 - 53:34
    seem cool? So with that, that brings us to
    G.R. LoRa, which is an out of frequency
  • 53:34 - 53:39
    radio module that I've been working on for
    for the last couple of months. And it's an
  • 53:39 - 53:42
    open source implementation of the fire
    that works very nicely with the GANU radio
  • 53:42 - 53:47
    software, defined radio, digital signal
    processing toolkit. It's open source
  • 53:47 - 53:52
    software, its free software. It's got a
    great community built up around it. It's
  • 53:52 - 53:55
    really cool. If you're curious about ETR,
    there are loads of good tutorials. And
  • 53:55 - 53:58
    even if you're a wizard, well, if you're a
    wizard, you already know what this is. But
  • 53:58 - 54:04
    it's a really, really great, great piece
    of software and ecosystem. And why is
  • 54:04 - 54:08
    having an open source version of this
    interesting, well, existing interfaces to
  • 54:08 - 54:13
    LoRa or layer to and above, both with the
    the data sheets that we get that go with
  • 54:13 - 54:18
    each of the different lower radios and the
    standards that are available and open.
  • 54:18 - 54:22
    It's all layer tuneup. We don't have any
    insight into what the fi state machine
  • 54:22 - 54:28
    actually does. And FIGLIA security really
    can't be taken for granted. And to to back
  • 54:28 - 54:32
    this up, I'm going to point to some eight
    to 15 for exploits that that kind of
  • 54:32 - 54:37
    reinforce this from a couple of years ago.
    We have traves good speeds packet packet
  • 54:37 - 54:40
    that show that he was able to do a full
    seven layer compromise by basically
  • 54:40 - 54:46
    encoding the data that would induce the
    preamble and subframe symbols for eight to
  • 54:46 - 54:49
    15 for within the payload of another
    message, he was able to get some really
  • 54:49 - 54:54
    wonky things to happen to radio state
    machines in doing so. And related to that,
  • 54:54 - 54:59
    we have this wireless intrusion detection
    system evasion that was done by Travis
  • 54:59 - 55:03
    Good and some friends of mine from
    Dartmouth. Where they were basically able
  • 55:03 - 55:07
    to fingerprint how different Itochu for
    radio state machines work and construct
  • 55:07 - 55:12
    packets that would be able to be heard by
    some but not others. So from that, you
  • 55:12 - 55:16
    could basically identify generate versions
    of packets that weren't totally compliant
  • 55:16 - 55:20
    with the standard, but would still be
    heard by certain receivers and not others.
  • 55:20 - 55:24
    So some really tricky stuff here. Phi's
    really matter. You can't take them for
  • 55:24 - 55:28
    granted in the picture of security. So my
    hope with this is by getting this tool out
  • 55:28 - 55:32
    there, we can actually really start to
    look at the surface and figure out how it
  • 55:32 - 55:35
    works and how it can be made better and
    really start to start to get involved with
  • 55:35 - 55:40
    improving the security of this new
    protocol through some prior to site. Josh
  • 55:40 - 55:45
    Blum has a module for both of us, which is
    a kind of like a competitor to radio. It's
  • 55:45 - 55:49
    like another framework. It gets the
    modulation right. But the decoding is is
  • 55:49 - 55:52
    basically off of the documentation so it
    can talk to itself, but it can't talk to
  • 55:52 - 55:56
    actual hardware because it doesn't
    implement the real decoding stage that we
  • 55:56 - 56:00
    had to reverse engineer. And also, there's
    another Gahler out there made by this guy,
  • 56:00 - 56:05
    RPV zero on GitHub. When I first looked at
    it, it was like this python thing that I
  • 56:05 - 56:09
    couldn't quite get to work. I went, What
    did you get last night? Actually looks
  • 56:09 - 56:12
    pretty cool. So you might check that out,
    too, if you're interested in this. Looks
  • 56:12 - 56:16
    like it's it's pretty, pretty solid. So
    Migiro LoRa implements modulation encoding
  • 56:16 - 56:20
    in separate blocks so that you can you can
    be modular and experiment. So if you want
  • 56:20 - 56:23
    to have like a multiple kind of like a
    common two layer for error correcting
  • 56:23 - 56:26
    thing, you better resiliency. You can
    write that in without having to touch the
  • 56:26 - 56:30
    demodulator. Told you a couple for you.
    Also, there's a very simple asynchronous
  • 56:30 - 56:36
    PDU interface for passing data between the
    blocks and you basically write to it just
  • 56:36 - 56:39
    using websocket, which is really easy.
    I'll demonstrate in a minute and it's just
  • 56:39 - 56:44
    like I you know, two fifteen four which is
    a great eight to 15 four, which is a
  • 56:44 - 56:49
    really great module made by Bastiaan, who
    I think is here really, really cool tool I
  • 56:49 - 56:54
    used all the time. So demodulator, the
    demodulator in the decoding implements the
  • 56:54 - 56:59
    process that we just reverse engineered
    using the stack, the 50s and all that. The
  • 56:59 - 57:01
    modulator in the encoder use a more
    efficient method that does direct
  • 57:01 - 57:05
    synthesis of chirps. So rather than like
    basically computing the fifty results and
  • 57:05 - 57:09
    then doing an effect of that, we can
    actually index into a pre computed chirp
  • 57:09 - 57:13
    to make the generation a lot more
    computationally efficient. If you want the
  • 57:13 - 57:20
    source right there just pushed a giant
    update to it about two hours ago. So if
  • 57:20 - 57:24
    you're interested in playing with it,
    there it is. Let's run through a quick
  • 57:24 - 57:28
    demo before we're out of time here. So
    here's a scenario. I've written you guys a
  • 57:28 - 57:32
    poem. I'm going to play you guys a poem.
    And I want to be able to sniff it and show
  • 57:32 - 57:38
    you what it is. Right. So to transmit, we
    have our ative fruit. It's an idea for
  • 57:38 - 57:43
    radio, like an Arduino basically with a
    lower radio on it. And to receive it,
  • 57:43 - 57:46
    we're going to use our USP right down
    here. And of course, it's all being
  • 57:46 - 57:54
    received by G.R. LoRa. So I'm going to
    jump over to my VM if I can see if I can
  • 57:54 - 58:13
    get this up on the other screen. Bear with
    me one moment. There we go. Show you the
  • 58:13 - 58:22
    interview of my password. We're going to
    start a receiver here and now I'm. Going
  • 58:22 - 58:34
    to just open a. Sock it here. And I'm
    going to. Sir, my transmitter and let's
  • 58:34 - 59:00
    see what we have for you. In case you're
    unsure of what you're looking at. So
  • 59:00 - 59:04
    that's all over, LoRa. There are few to
    do's, if you want to contribute, be happy
  • 59:04 - 59:09
    to have you do so, some additional
    resources if you want to know more. I've
  • 59:09 - 59:13
    written this up all in detail in traves
    good speeds, PIERCEY or ETFO. The most
  • 59:13 - 59:17
    recent issue has that in there. Also, if
    you want to learn more about Radio's NDR,
  • 59:17 - 59:21
    my colleague Mark and I are giving a talk
    at Shukan and Troupers called. So you want
  • 59:21 - 59:24
    to talk radio's, which is going to go
    through how to reverse engineer really
  • 59:24 - 59:28
    basic Iot modulations. It'll spend a lot
    more time on some of the basics and show
  • 59:28 - 59:32
    you how to actually apply the stuff
    yourself to wrap up. LPI plans are
  • 59:32 - 59:36
    exploding. They have tons of momentum and
    are popping up everywhere. RF stacks are
  • 59:36 - 59:40
    also becoming more diverse. So when you're
    talking about securing your wireless air
  • 59:40 - 59:44
    space, you're not just worrying worried
    about Wi-Fi anymore. If you're a corporate
  • 59:44 - 59:47
    security administrator, you work in
    corporate I.T. You also have to worry
  • 59:47 - 59:50
    about all these other, like, Iot
    appliances that are coming into your
  • 59:50 - 59:55
    enterprise and are starting to take root.
    On a technical note, we've shown how to go
  • 59:55 - 59:59
    from some obscure modulation into bits.
    We've also added a new tool to the
  • 59:59 - 60:04
    researchers arsenal. I want to thank
    Bollon Sieber Bestival. He's an incredible
  • 60:04 - 60:07
    resource and this would have been possible
    without him. Also, the open source
  • 60:07 - 60:12
    contributors who helped get here helped us
    all get here. And finally, the Chaos
  • 60:12 - 60:19
    Computer Club for organizing 33c3 and
    having me. So thank you very much. Thank
  • 60:19 - 60:25
    you for your attention. And I'd be happy
    to take your questions.
  • 60:25 - 60:36
    Applause
  • 60:36 - 60:46
    Herald: We are almost out of time, thank
    you very much, Matt. We're able to take
  • 60:46 - 60:50
    very few and brief questions. So
    microphone in front, right, please.
  • 60:50 - 60:54
    Matt: I remember you. We met in your video
    conference. Good to see you.
  • 60:54 - 60:58
    Mic: Yes. There are two ways to quantify
    the reliability of a dense LoRa network.
  • 60:58 - 61:01
    Matt: Could you repeat that, please?
    Mic: Is art a ways to quantify the
  • 61:01 - 61:05
    reliability of a dense LoRa network?
    Matt: I'm sure there are. I haven't really
  • 61:05 - 61:11
    looked at all at benchmarking or figuring
    out what kind of the limits are. My
  • 61:11 - 61:15
    interest has really been in getting the
    decoding information extraction done. I
  • 61:15 - 61:19
    know that there's a group in San Francisco
    that's building deep networks that
  • 61:19 - 61:23
    building a LoRa product or network of some
    sort. They've done some benchmarking of
  • 61:23 - 61:28
    how LoRa works in cities and they have a
    blog post. That's pretty good. You might
  • 61:28 - 61:30
    check that out.
    Herald: We have one question from the
  • 61:30 - 61:34
    Internet via our Signal Angel?
    Signal Angel: Our panel on the IAC is
  • 61:34 - 61:36
    asking, how long did it take to figure out
    all of this?
  • 61:36 - 61:41
    Matt: So, you know, I first saw LoRa in
    the wild in January and kind of just let
  • 61:41 - 61:50
    the capture sit in my sitting by my hard
    drive for a while. It probably took about
  • 61:50 - 61:54
    four or five weeks of working on this,
    more or less full time, I was a little bit
  • 61:54 - 61:57
    I had some other things working on, too,
    I'd say probably four weeks from what I
  • 61:57 - 62:00
    actually said. All right. Let's figure
    this thing out to having the initial
  • 62:00 - 62:05
    results.
    Herald: Another question from the rear
  • 62:05 - 62:09
    right microphone.
    Mic: So in decoding those two unknown
  • 62:09 - 62:16
    layers, you had your proprietary hardware
    and you could send it data and it'll it
  • 62:16 - 62:20
    won't do the AES and encryption stuff and
    it just sends that encoding.
  • 62:20 - 62:25
    Matt: That's a great question. I kind of
    skipped over that the microchip LoRa radio
  • 62:25 - 62:29
    that I had this guy right here. I also
    wanted another one that was a LoRa when
  • 62:29 - 62:34
    radio. This is a LoRa radio, but actually
    exposes an API to pause the Maxsted
  • 62:34 - 62:38
    machine so you can turn off all the layer
    two stuff that would add a header in
  • 62:38 - 62:44
    encryption, stuff like that, and send what
    are close to arbitrary frames. And I say
  • 62:44 - 62:48
    what are close to arbitrary frames because
    you can't turn off the implicit header. So
  • 62:48 - 62:50
    it's always an implicit or sorry, you
    can't turn off explicit headers, it's
  • 62:50 - 62:54
    always in the explosive header mode. So
    this more or less exposed raw raw payload
  • 62:54 - 62:56
    injection.
    Mic: OK, thanks.
  • 62:56 - 63:00
    Herald: Yeah, we're already in overtime.
    We're taking one last question from our
  • 63:00 - 63:03
    Signal Angel on IRC and then we'll have to
    wrap up.
  • 63:03 - 63:07
    Matt: I'll be happy to hang out and answer
    questions after the fact too.
  • 63:07 - 63:11
    Mic: Now many people are wondering what
    implications does it have that basically
  • 63:11 - 63:17
    the patent is not used at all? So could
    you could you say that the technology is
  • 63:17 - 63:23
    patent free In a way?
    Matt: I am not a lawyer, but I have known
  • 63:23 - 63:27
    lawyers and I know that they're clever
    enough to not fall for that. So I'm sure
  • 63:27 - 63:31
    that I'm sure that the patent was defined
    as generally as possible. And again, it
  • 63:31 - 63:36
    describes a modulation similar to LoRa.
    I'm again not a lawyer, but I'm almost
  • 63:36 - 63:43
    certain that that that that it would be
    covered. So but that's a clever thought.
  • 63:43 - 63:50
    Herald: Thank you, Mike. Please give him a
    warm round of applause. Thank you again.
  • 63:50 - 63:52
    applause
  • 63:52 - 63:56
    33c3 postrol music
  • 63:56 - 64:16
    Subtitles created by c3subtitles.de
    in the year 2021. Join, and help us!
Title:
Decoding the LoRa PHY (33c3)
Description:

more » « less
Video Language:
English
Duration:
01:04:16

English subtitles

Incomplete

Revisions