1 00:00:04,060 --> 00:00:06,700 Well, hello everybody. 2 00:00:06,700 --> 00:00:15,580 My name is Manuel Rabade and I am going to present a small pocket of bits that can save or destabilize a city. 3 00:00:16,400 --> 00:00:18,860 Thank you very much for coming in. 4 00:00:19,800 --> 00:00:23,400 I'm very happy to present this. 5 00:00:23,940 --> 00:00:34,820 So what we are going to see, we are going to talk about the systems that send alerts before danger using wireless methods. 6 00:00:35,000 --> 00:00:46,000 So we are going to explore how they work, their limitations, and why everybody can generate these signals. 7 00:00:48,780 --> 00:01:01,700 This talk is not only technical, it's also about my journey into this kind of project and what I consider to be the core of hacking. 8 00:01:01,700 --> 00:01:09,860 The curiosity to understand how things work, explore their boundaries, and share that information. 9 00:01:11,140 --> 00:01:18,800 So what we are going to talk about first, we are going to talk about the Mexican seismic alert system. 10 00:01:21,960 --> 00:01:28,680 Radio frequency plays a key role here, not only for sending the alerts, but for the core of the system. 11 00:01:28,680 --> 00:01:31,540 It's something like pretty interesting. 12 00:01:32,440 --> 00:01:37,660 We are going to talk then about the EAS same system. 13 00:01:38,520 --> 00:01:44,580 This is the system that works here in the US to transmit alerts. 14 00:01:44,920 --> 00:01:50,740 We are going to see how it works, how the messages are sent, how they are encoded. 15 00:01:51,860 --> 00:02:00,600 Then I'm going to show you how you can receive, how can you decode, and how can you generate these signals, these alert messages. 16 00:02:01,020 --> 00:02:08,780 And then we will wrap up with some final thoughts about the performance of these systems. 17 00:02:11,740 --> 00:02:14,700 First of all, a little bit about me. 18 00:02:14,700 --> 00:02:18,720 I started learning computers and electronics in the 90s. 19 00:02:18,720 --> 00:02:23,000 I was very heavily involved in the post-community in the 2000s. 20 00:02:23,000 --> 00:02:31,240 At the same time I studied computer engineering at the Autonomous National University of Mexico. 21 00:02:32,100 --> 00:02:40,940 I have been working 20 years in software engineering, in marketing, start-ups, government, fintech, doing software, hardware, infrastructure, you name it. 22 00:02:41,460 --> 00:02:45,780 Recently I have been collaborating with RF Villaje Mexico. 23 00:02:45,880 --> 00:02:57,480 It's a new project we have in Mexico City, but also in other cities of Mexico that we are doing on the security events like these ones, or smaller ones. 24 00:02:57,480 --> 00:03:02,880 We are doing something like CTF, talks, and well. 25 00:03:02,880 --> 00:03:20,000 What I am telling you this because, well, I just want to mention I am not an expert on seismic science, on alert messages, and all that stuff. 26 00:03:20,000 --> 00:03:31,940 I am just an enthusiast like many of you that, well, I have found this subject to be very interesting and I have learned and now I am sharing about it. 27 00:03:31,940 --> 00:03:37,420 So this story begins in 1985. 28 00:03:37,560 --> 00:03:42,620 We had like a very big earthquake in Mexico City. 29 00:03:43,600 --> 00:03:48,940 At that time there were 10 million people in Mexico City. 30 00:03:48,940 --> 00:03:59,060 And, well, there were about 40,000 casualties. 31 00:03:59,060 --> 00:04:11,340 So this was big, like about 400 buildings collapsed, 100,000 homes were affected. 32 00:04:11,340 --> 00:04:20,960 So yeah, this mark, like from my generation to older ones, like everybody talks about the 1985 earthquake. 33 00:04:21,540 --> 00:04:29,400 So, as you can see, well, for me personally in this picture, you see there used to be like three buildings there. 34 00:04:29,400 --> 00:04:33,640 My grandparents used to live in the one that's still standing. 35 00:04:33,680 --> 00:04:35,200 So yeah, it was pretty scary. 36 00:04:35,560 --> 00:04:43,060 Their home was not demolished, but it was demolished later because the building was not any more usable. 37 00:04:43,060 --> 00:04:47,540 So earthquakes are a big thing in Mexico City. 38 00:04:47,980 --> 00:04:54,140 So why is Mexico City so affected by earthquakes? 39 00:04:54,200 --> 00:04:56,460 There are two reasons. 40 00:04:56,460 --> 00:05:04,320 The first reason is the city is built in a lake bed. 41 00:05:04,840 --> 00:05:18,620 You see the picture, well, the painting on the left is a painting of what it used to be in Mexico City at the time when the Spanish reached. 42 00:05:19,400 --> 00:05:24,300 So on the right of that, it's a picture of almost the same perspective. 43 00:05:24,300 --> 00:05:27,620 You see there is no lake anymore. 44 00:05:27,680 --> 00:05:33,680 So the problem with this is that the soil amplifies the earthquake. 45 00:05:34,240 --> 00:05:37,180 The earthquake is very soft. 46 00:05:37,340 --> 00:05:44,220 So that's the first reason why Mexico City is very heavy affected by earthquakes. 47 00:05:44,220 --> 00:05:55,520 And the second reason is on the right, you see that Mexico is between the tectonic plate of North America and the Cocos Plate. 48 00:05:55,520 --> 00:06:08,500 So the Cocos Plate is pushing the North American plate and it generates in that sector, you see the many points, it generates a lot of seismic activity that becomes earthquakes. 49 00:06:08,540 --> 00:06:17,380 So that's the two reasons like Mexico and Mexico City, it's very prone to have big earthquakes. 50 00:06:18,960 --> 00:06:25,240 Yeah, like, we have like, each year we have between 10 and 20 earthquakes. 51 00:06:25,440 --> 00:06:27,760 Small ones and medium ones. 52 00:06:27,760 --> 00:06:28,720 Well, not small. 53 00:06:28,720 --> 00:06:30,320 Medium and strong. 54 00:06:30,320 --> 00:06:34,420 And each year we have between one and three strong ones. 55 00:06:34,640 --> 00:06:40,200 And one time each, in 10 years, we have a very strong one. 56 00:06:40,220 --> 00:06:42,380 Like the 1985 one. 57 00:06:42,620 --> 00:06:47,740 So the last big one was in 2017. 58 00:06:47,940 --> 00:06:50,100 Some buildings collapsed. 59 00:06:50,100 --> 00:06:52,960 It was not as hard as 1985. 60 00:06:53,220 --> 00:06:55,280 But yeah, we have casualties. 61 00:06:55,980 --> 00:06:58,560 And well, it was hard. 62 00:06:58,980 --> 00:07:03,060 So after 1985, what happened? 63 00:07:03,060 --> 00:07:06,700 Some scientists, engineers, came. 64 00:07:06,700 --> 00:07:20,820 I don't know the details of the story, but I imagine that some scientists come to the government and say, OK, we have a very big earthquake, so we have some very cool science like we want to talk to you about. 65 00:07:20,820 --> 00:07:30,500 So the earthquake was, 1985, was originated in, you see the little star there. 66 00:07:30,520 --> 00:07:35,820 So it was generated 390 kilometers away from Mexico City. 67 00:07:35,820 --> 00:07:45,820 And Mexico City is, you can see like the yellow spot and orange in the middle of the country. 68 00:07:45,820 --> 00:07:59,900 So the earthquake is 390 kilometers away, but seismic waves travel at about 4.5 kilometers per second. 69 00:08:00,120 --> 00:08:09,000 So when the seismic wave, when the earthquake is generated, it takes almost one and a half minutes to reach Mexico City. 70 00:08:09,120 --> 00:08:18,960 So what happens, because well, and they see, OK, the radio frequency, what the speed is about 300 kilometers per second. 71 00:08:19,060 --> 00:08:31,620 So if we send a signal from where the, when the earthquake happens, it will reach one minute, 24 seconds before the earthquake hits Mexico City. 72 00:08:31,720 --> 00:08:42,020 So this is the science, well, this is all science, like I think in the 19th or 18th century, somebody discovered this, the speed of seismic waves. 73 00:08:42,180 --> 00:08:46,600 But when they see we have this big earthquake, we can do this. 74 00:08:47,260 --> 00:08:59,560 So in 86, Mexico City government, federal government, all the governments, founded the Center for Seismic Implementation and Recording. 75 00:08:59,560 --> 00:09:01,480 The CIRES. 76 00:09:01,540 --> 00:09:13,220 The first thing they did was to install a network of accelerometers in Mexico City to measure how the earthquakes feel in Mexico City. 77 00:09:13,220 --> 00:09:19,980 And they proposed this system we see on the right of the screen. 78 00:09:19,980 --> 00:09:38,200 They installed a network of sensors to sense the earthquakes on the coast, where the tectonic plates are hitting, and to send the signals to Mexico City and to process it very fast. 79 00:09:38,520 --> 00:09:48,540 And if the seismic activity was worth enough, to send an alert to all the population in Mexico City. 80 00:09:49,020 --> 00:09:54,920 So they developed this system that was activated in 91. 81 00:09:56,480 --> 00:10:14,160 And well, they developed a sound, a very distinctive sound, like... I will not play it, because people from Mexico City, when you hear that sound, the skin, yeah, you feel it. 82 00:10:14,940 --> 00:10:19,340 Like... Yeah, something like that. 83 00:10:19,340 --> 00:10:27,240 They invented this sound, and well, this... What happened? 84 00:10:27,240 --> 00:10:34,620 In 93, I think it was the first seismic event that was alerted. 85 00:10:34,620 --> 00:10:52,400 Yeah, they... And they do the science, like... You can see the publications, like, okay, we got this signal on the coast, and we got this signal in Mexico City, so they verified the science was working. 86 00:10:53,060 --> 00:10:58,180 And well, CIRES is an academic engineering organization. 87 00:10:58,180 --> 00:11:01,660 It has a lot of scientific and outreach publications. 88 00:11:01,660 --> 00:11:02,640 Very interesting. 89 00:11:02,640 --> 00:11:17,440 If you want to know more about it, like, they have papers about also the social part of this kind of system, like how they perform, comparing to other systems in the world. 90 00:11:17,900 --> 00:11:18,840 Okay? 91 00:11:19,300 --> 00:11:24,580 So this is the Mexican Seismic Alert, how it works. 92 00:11:24,580 --> 00:11:28,220 You have the sensor stations on the coast. 93 00:11:28,220 --> 00:11:41,100 You have a network of concentrators and repeaters, like everything is also sent by RF to these concentrators, and then came to a central station that even the location in the city is secret. 94 00:11:41,340 --> 00:11:42,860 Well, it's not published. 95 00:11:43,520 --> 00:12:06,260 And well, this central station that runs very interesting software, there are papers about it, like how do you do this prediction of the seismic event, and if it's worth to send the alert, because, well, if you have an alert popping, like, every week or every month, 96 00:12:06,260 --> 00:12:09,880 you will lose the fear of this alert. 97 00:12:10,000 --> 00:12:10,340 Yeah? 98 00:12:10,340 --> 00:12:13,780 So they take it, like, very seriously. 99 00:12:13,880 --> 00:12:16,040 So this central station is connected. 100 00:12:16,040 --> 00:12:24,160 I don't know how, that's the question I'm asking, to several systems to broadcast this alert. 101 00:12:24,160 --> 00:12:37,260 Like the first system was direct links to the Mexican city government, to the subway system, to these organizations of the government. 102 00:12:37,260 --> 00:12:45,360 Also, it was sent to radio stations, to television at the beginning. 103 00:12:45,920 --> 00:12:54,720 So to schools, I remember my school, when I was a boy, it had a very big radio, like, receive these alerts. 104 00:12:55,100 --> 00:13:03,740 So in 2008, they start installing the EAS, same transmitter network. 105 00:13:04,760 --> 00:13:09,260 This was 2008, like, not so long ago, we will see. 106 00:13:09,260 --> 00:13:14,180 And they start to install receivers for this in government buildings. 107 00:13:14,180 --> 00:13:18,820 They started with government buildings, and then commercial buildings. 108 00:13:18,860 --> 00:13:26,840 And well, that's why the red square is there, because that's what we will be talking about, right? 109 00:13:26,840 --> 00:13:32,860 We will be talking about all the other systems, like, I talk about it because I think it's cool. 110 00:13:33,320 --> 00:13:39,620 I'm really happy that we have this, but now we are going to talk about these networks. 111 00:13:40,100 --> 00:13:43,280 They are also testing the self-broadcast. 112 00:13:44,340 --> 00:13:56,920 I think here it's a little bit more widely used, like, you get the AMBER alerts on your cell phone, but yeah, in Mexico City, they are still testing it. 113 00:13:57,620 --> 00:14:09,220 It's not working very well, so like, yeah, yeah, it's not... they have to work with the mobile operators and I haven't received a signal yet. 114 00:14:09,220 --> 00:14:19,140 Because, well, in Mexico City, there are two times a year they send a signal, like, to simulacros, I don't know how to say it in English, it's like drills. 115 00:14:19,480 --> 00:14:22,380 There are drills two times a year about this. 116 00:14:22,380 --> 00:14:24,040 So yeah, it's a pretty big deal. 117 00:14:25,860 --> 00:14:38,300 And well, for example, the direct links that are sent to the government, the government of Mexico City has a network of speakers in the city. 118 00:14:38,300 --> 00:14:48,020 They don't cover the whole city, but in several parts of the city, you hear this sound, like, wah, wah, wah, wah. 119 00:14:48,020 --> 00:14:50,920 So yeah, like, people, it's pretty aware. 120 00:14:50,920 --> 00:14:59,320 So if you're in Mexico City and hear this sound, do what the other people do and you will be safe. 121 00:15:00,180 --> 00:15:04,480 And you will know how it will hit in a couple of minutes. 122 00:15:04,840 --> 00:15:06,520 Not so long. 123 00:15:07,220 --> 00:15:07,840 Okay? 124 00:15:08,720 --> 00:15:18,400 So yeah, just to wrap up, you can see on the left, it's the current state of the sensors. 125 00:15:18,580 --> 00:15:22,060 We start with 12 sensors in Mexico. 126 00:15:22,060 --> 00:15:23,440 There are a lot of more. 127 00:15:23,440 --> 00:15:25,620 They are expanding this system. 128 00:15:25,960 --> 00:15:31,600 And on the right, it's the network of transmitters we have in Mexico. 129 00:15:31,600 --> 00:15:43,240 We have about 20, 15, something like that, that covers, doesn't cover all of Mexico, but covers the central part that is the more populated. 130 00:15:43,240 --> 00:15:52,980 So like, 30 million of people depends on this system to get alerts about this kind of danger. 131 00:15:52,980 --> 00:16:03,320 So even if, as we are going to see, it's an old system, it's pretty relevant still. 132 00:16:03,320 --> 00:16:13,420 Like I just see a sticker in another village that says that legacy technology doesn't die, it just becomes critical infrastructure. 133 00:16:13,800 --> 00:16:16,900 Something like that we have with these systems. 134 00:16:16,900 --> 00:16:18,700 Yeah, they don't die. 135 00:16:18,700 --> 00:16:24,960 Yeah, so where was the aha moment for me? 136 00:16:25,040 --> 00:16:33,680 You can see on the left, this is the transmitters that were being installed first on government buildings. 137 00:16:33,680 --> 00:16:54,200 So in about 2010s, in the early 2010s, I saw one of these receivers and I see that they have this public alert logo and I see like a NOAA logo and then I see on the Spark phone, I don't remember what was first. 138 00:16:54,500 --> 00:17:12,660 Like if I see the radio of the Spark phone, but I see like, okay, this breakout board from Spark phone, they talk about NOAA and maybe it's not, because well, you see the radios, here it's open, but normally they are closed. 139 00:17:12,680 --> 00:17:20,860 So you think maybe it's some custom technology, I don't know, because they were not announcing how they were building this. 140 00:17:21,300 --> 00:17:29,120 So I bought some breakout boards and well, I built my receiver. 141 00:17:29,280 --> 00:17:39,100 So yeah, in 2010s, what you do when you start receiving something cool, you build a Twitter box. 142 00:17:39,100 --> 00:17:52,980 So yeah, it was popular to get on Twitter the alerts, so I published a project, SeismoAlerta, like seismic alert. 143 00:17:53,180 --> 00:18:05,300 So you can see the receiver on the right, I built, and well, some Twitter and some SeismoAlerta on the 20th of March of 2015. 144 00:18:05,960 --> 00:18:18,680 So yeah, that triggered... well, some people were very interested, I made a workshop to build these receivers on a makerspace in Mexico City, Acedores Makerspace. 145 00:18:18,760 --> 00:18:44,920 So there were like eight people, we built some receivers, so yeah, the government published some like, oh, you remember, the internet channels are not official channels for this kind of alert, because they can have delays, and you know, I didn't take it very seriously, 146 00:18:44,920 --> 00:18:57,600 but yeah, like, okay, well, I added a disclaimer, it's not official, you build it at your own risk, this is not official. 147 00:18:58,080 --> 00:19:23,200 But at the same time, there were other people that were very critical of the government, because the government funded this, but there was a company, a private company, for profit, selling the receivers, and these receivers were the only ones authorized by the government, 148 00:19:23,200 --> 00:19:32,980 so there was no way to make one receiver, or to make it comply with the law. 149 00:19:32,980 --> 00:19:52,840 So there were some people, I don't know them, but they started to be very vocal about this, until the government made a standard, and they said, okay, we will receive applications, so you can build a receiver, or sell a receiver. 150 00:19:52,860 --> 00:20:10,400 But at the same time, I don't know if it was good or bad, I have mixed feelings about it, they modified the standard, and well, the receivers from the US market no longer work for their quick alerts. 151 00:20:10,720 --> 00:20:14,620 We are going to see what they changed later. 152 00:20:14,960 --> 00:20:29,360 So well, you see the logos of the companies, Alertandote and Sina, they built receivers that comply with the law, they send them to review, and to be authorized. 153 00:20:30,140 --> 00:20:36,800 And well, I'm very happy, because I know at least one of these companies is using the software I published. 154 00:20:36,880 --> 00:20:38,660 Yeah, I know for the developers. 155 00:20:39,600 --> 00:20:52,200 It's cool to have help to build this small ecosystem of entrepreneurs around this in Mexico City. 156 00:20:53,860 --> 00:21:10,280 And well, then I studied engineering, so I needed a project to finish my studies, so I built a receiver, like a formal one, I built the documentation, testing, following the rules. 157 00:21:11,100 --> 00:21:18,880 I also published it, as you know, any dissertation about a degree in Mexico has to be published. 158 00:21:19,720 --> 00:21:28,220 So yeah, this was the receiver I built, the PCB on the center is the one I designed, I programmed, and I talked about. 159 00:21:28,400 --> 00:22:01,100 And then when I was doing the research for this, you know, for the document you have to deliver, is when I started learning the details of how the EAS systems, the alerts are transmitted, are encoded, and that's the second aha moment, like, okay, so this is not so complex or even secure as you would think about it, 160 00:22:01,100 --> 00:22:02,100 right? 161 00:22:02,460 --> 00:22:07,340 So yeah, that's where this idea, this talk, it was born. 162 00:22:10,020 --> 00:22:16,320 So, we are going to jump to talk about the EAS, same system. 163 00:22:16,320 --> 00:22:21,100 I don't know how many of you know what it is, can you raise your hand? 164 00:22:22,360 --> 00:22:32,620 Yeah, I think it's popular here, but as you just saw, it's very relevant to Mexico City, like the people living there. 165 00:22:33,160 --> 00:22:41,140 I know it's useful here, but for certain areas that are prone to certain dangers. 166 00:22:42,160 --> 00:22:45,760 So what is the EAS? 167 00:22:45,760 --> 00:22:51,260 The EAS is short for Emergency Alert System, and it's a system nationwide here in the U.S. 168 00:22:51,260 --> 00:22:56,160 to notify the public about natural disasters, security threats, or civilian emergencies. 169 00:22:56,400 --> 00:23:09,860 And the same protocol is short for Specific Area Missation Coding, and it's a digital format used to transmit information about the type and location of hazards, such as severe weather or other dangers. 170 00:23:09,860 --> 00:23:12,800 So that's the EAS, same system. 171 00:23:13,140 --> 00:23:24,680 So the origin, I think this is very cool, like the origin is from the Chicago area, when they started broadcasting this marine weather broadcast. 172 00:23:24,680 --> 00:23:32,820 So they were transmitting it in 162.55 megacycles, not megahertz, megacycles. 173 00:23:32,820 --> 00:23:34,680 It's cool to know that. 174 00:23:35,000 --> 00:23:43,440 So yeah, this was a frequency VHF that they were transmitting like just a weather report. 175 00:23:43,980 --> 00:23:50,420 It's not FM radio, it's a little bit different, a little bit higher, but it's the same. 176 00:23:50,420 --> 00:23:54,120 They were transmitting voice messages about the forecast. 177 00:23:56,820 --> 00:24:00,020 So yeah, so this system started evolving. 178 00:24:00,300 --> 00:24:04,620 Like I say, in the 60s, the weather information broadcast in the U.S. 179 00:24:04,620 --> 00:24:10,780 In the 70s, in 71, they introduced the warning alarm tone. 180 00:24:10,780 --> 00:24:18,100 It was a tone that was made for... you didn't have to have your receiver on all the time. 181 00:24:18,120 --> 00:24:29,960 If your receiver could be like the speaker off, and if they get this tone, the goal was to turn on the speaker, and you would hear the alert. 182 00:24:29,960 --> 00:24:32,700 So that's the warning alarm tone. 183 00:24:32,880 --> 00:24:50,500 But it was on the same frequency, so then they designed this network transmitter, the NOAA weather radio, and well, in 88, after 10 years of development, the NWBS, the National Weather Relay, the same protocol. 184 00:24:50,500 --> 00:24:57,880 So what I'm trying to clarify here is things move slow with this kind of systems. 185 00:24:57,880 --> 00:25:00,120 It's not very fast. 186 00:25:00,600 --> 00:25:15,280 And then in the 97, 10 years after it was released, it was adopted in the U.S., and then almost 10 years after that, it was adopted in Mexico. 187 00:25:15,280 --> 00:25:26,420 So if we see at this timeline, maybe this is a legacy system, but it will be in use I think for at least another 10 years. 188 00:25:30,580 --> 00:25:36,340 NOAA weather radio, it covers 90% of the 50 U.S. 189 00:25:36,340 --> 00:25:38,240 states, as you can see. 190 00:25:38,240 --> 00:25:44,520 In Mexico, it covers just the center part, but we have only like 15. 191 00:25:44,740 --> 00:25:52,480 You have over 750 transmitters. 192 00:25:52,640 --> 00:25:55,060 It's a pretty big network. 193 00:25:55,940 --> 00:26:01,000 So yeah, this is where the fun begins. 194 00:26:01,600 --> 00:26:04,600 So how it works, NOAA weather radio. 195 00:26:04,600 --> 00:26:08,900 So on the right, there is the table of the channels, the frequencies. 196 00:26:08,920 --> 00:26:13,260 As you can see, the first frequency on the table is the same from the 60s player. 197 00:26:13,540 --> 00:26:15,740 So yeah, they continue to use it. 198 00:26:15,740 --> 00:26:17,800 They haven't changed it. 199 00:26:17,800 --> 00:26:19,260 Well, I understand it. 200 00:26:19,260 --> 00:26:20,660 Why did you change it? 201 00:26:22,380 --> 00:26:29,520 Because, well, after you see they are using the same frequency, you just added the warning alarm tone, then the summit protocol. 202 00:26:29,520 --> 00:26:34,180 So in theory, if you have a 60s radio, it should still work. 203 00:26:35,820 --> 00:26:44,680 So yeah, the range of this transmitter is up to 40 miles on flat terrain. 204 00:26:44,680 --> 00:26:47,360 And well, the modulation is wide FM. 205 00:26:47,540 --> 00:26:51,560 It's wide FM modulation like any radio modulation. 206 00:26:52,000 --> 00:26:57,440 So yeah, and well, what about the same protocol? 207 00:26:57,440 --> 00:27:08,680 The same protocol, these are like digital broadcasts that you hear on these channels. 208 00:27:08,680 --> 00:27:13,860 On AF-SK modulation, audio frequency shift key. 209 00:27:14,020 --> 00:27:19,660 So yeah, they have a bit period of 1.92 milliseconds. 210 00:27:19,660 --> 00:27:30,020 That will be like about 50, yes, it's 520 bytes per second you can send. 211 00:27:30,080 --> 00:27:33,840 Yeah, there you see the logical 0, logical 1. 212 00:27:33,840 --> 00:27:47,520 There is a preamble of 16 bytes of A, B, C, 1, 0, 1, 0, 1, 0, 1, 1 that are sent before each broadcast, so the receivers can sync with this protocol. 213 00:27:48,140 --> 00:27:57,320 And well, the characters are encoded in ASCII, so the less significant bit is sent first. 214 00:27:58,920 --> 00:28:00,820 And well, that's all. 215 00:28:00,820 --> 00:28:10,980 So when I saw this, when I was writing my designation, this is something you can write, you can decode even, you can see it and you can count it. 216 00:28:12,340 --> 00:28:18,440 So on the right is the structure of one message. 217 00:28:18,440 --> 00:28:20,780 It's composed of four sections. 218 00:28:20,960 --> 00:28:30,480 There is a header , an alert tone, the ones from the 70s, then a voice message that's optional, and then an end of message. 219 00:28:30,580 --> 00:28:35,420 So the header is where all the information about the alert is sent. 220 00:28:36,880 --> 00:28:52,240 They send the same protocol, send the message three times, so the receiver must choose each bit, like two of three, if it's the same, they build the message. 221 00:28:52,240 --> 00:29:01,500 So as you can see, there is no error correction, so the receiver has to do it from the repetitions. 222 00:29:01,580 --> 00:29:11,740 And well, each header, it sends a preamble, then the header, a pause, and then another two. 223 00:29:12,820 --> 00:29:16,700 So let's see, well, this is the header. 224 00:29:16,700 --> 00:29:29,100 The header starts with the start of the header, then the organization, then the type of event, then the geographic area code, that's the 225 00:29:33,040 --> 00:29:36,320 area message encoding, that's the area part. 226 00:29:36,320 --> 00:29:39,560 They can send several of these codes. 227 00:29:39,560 --> 00:29:53,500 This is made so if you get the alert, for example, if one transmitter is on top of a hill, you see this in each side of the hill will receive the message. 228 00:29:53,620 --> 00:30:00,520 But why do I care if the alert is from the city on the other side of the hill? 229 00:30:00,520 --> 00:30:09,040 So you can configure your code area to your receiver and ignore alerts that don't match your receiver. 230 00:30:09,320 --> 00:30:14,960 So they also send expiration time and the issue date and time, and the transmitter ID. 231 00:30:15,120 --> 00:30:19,880 So this is the information they are sending in one of these headers. 232 00:30:20,040 --> 00:30:35,540 So the event type, EQWB, it's for equipment warning, ERDWT, it's a regular weekly test, TOR, it's for a tornado, and so on. 233 00:30:35,660 --> 00:30:39,620 So yeah, it's very simple. 234 00:30:40,880 --> 00:30:45,240 So, well, and how they implement it in Mexico. 235 00:30:45,240 --> 00:30:53,160 That's the interesting part for the ones that know how it works here in the US, so how we did it for Mexico. 236 00:30:53,380 --> 00:31:06,760 So yeah, first we have a law that says that in the workplace and in commercial buildings, you have to have a receiver for this kind of alerts. 237 00:31:07,080 --> 00:31:11,380 And then we have a technical standard, which is the standard about this. 238 00:31:11,420 --> 00:31:25,040 So in technical standard, they state a lot of things, but the most important part is ERDWT, the regular weekly test, is not sent weekly, it's sent daily, and each three hours. 239 00:31:25,740 --> 00:31:40,600 So yeah, this says a little bit about how this is important for us, like you have your receiver and it should have an alert on the receiver if after three hours it didn't get the weekly test. 240 00:31:40,780 --> 00:31:45,940 So you must check your antenna installation and so on. 241 00:31:46,160 --> 00:31:54,080 And then, their quick warning, the EQWB, it's sent three times. 242 00:31:54,300 --> 00:32:10,200 So three messages, like the ones we saw, without a voice message, without a warning tone, and if your receiver gets one of these messages, it must play the official audio within five seconds or 60 seconds. 243 00:32:10,200 --> 00:32:13,100 So they take out the voice message. 244 00:32:13,100 --> 00:32:16,260 So now, if you bought a U.S. 245 00:32:16,260 --> 00:32:20,440 receiver, it doesn't work in Mexico for this alert. 246 00:32:20,440 --> 00:32:35,780 So yeah, they say it's to make it more robust, but well, I disagree a little bit because a lot of people were buying receivers for the U.S. 247 00:32:35,780 --> 00:32:45,960 market because the price of an official receiver, they are 20% the price of an official receiver. 248 00:32:45,960 --> 00:32:53,940 So they were very cheap, and people were buying these and there was a market, but they were not officially recognized. 249 00:32:54,020 --> 00:32:59,460 So yeah, we can gossip about that. 250 00:33:00,000 --> 00:33:04,380 There is a lot to say about it. 251 00:33:05,280 --> 00:33:10,380 So let's see how can you receive the code and encode these messages. 252 00:33:10,440 --> 00:33:13,560 So that's the fun part, the theory. 253 00:33:13,860 --> 00:33:17,100 In practice, how can you receive these messages? 254 00:33:17,720 --> 00:33:30,460 As I say, you can use a commercial radio, like the Midland, or the ones that sell the government in Mexico City, and I think there are a lot of weather radios here in the U.S. 255 00:33:30,460 --> 00:33:50,540 You can use dedicated ICs, like the SI4707, that was the IC that was sold in the Sparkphone breakout that I showed you at the beginning that I used in my receiver and then used for my degree. 256 00:33:50,540 --> 00:33:52,120 I used the same one. 257 00:33:52,120 --> 00:33:57,580 It's a solution in one chip that tunes the code and does everything. 258 00:33:58,000 --> 00:34:12,020 But you can also use an SDR dongle, and that's what we are going to use to see how this is transmitted and we're going to decode it. 259 00:34:12,620 --> 00:34:15,560 So this is with SDR++. 260 00:34:15,880 --> 00:34:19,160 How do you see it in Mexico City? 261 00:34:19,640 --> 00:34:30,440 At least in my apartment, I get like three or four very strong signals about the weather radio. 262 00:34:30,440 --> 00:34:33,580 You can see it on the right. 263 00:34:33,580 --> 00:34:49,760 I even get the signal from another state, because there are a lot of transmitters in Mexico City because it's a city and they want to cover it because there are a lot of buildings and they want to have coverage. 264 00:34:50,020 --> 00:34:56,420 So I'm going to play what you hear on this audio channel. 265 00:34:57,280 --> 00:35:12,230 I don't think the audio is enabled for the presentation, but what you hear is the weather report for Mexico City. 266 00:35:12,990 --> 00:35:16,730 If you tune to one of these frequencies. 267 00:35:16,930 --> 00:35:18,710 So yeah, it's very easy. 268 00:35:21,450 --> 00:35:27,230 And then here we see the moment that they send these text messages. 269 00:35:27,230 --> 00:35:41,370 You can see like the three digital brushes of the message of the header that has all the information and then you have the three end of messages, like the small ones, messages. 270 00:35:41,590 --> 00:35:56,290 So now if you record this... yeah, you will not hear, but I don't know if... ah, you can hear it on my laptop. 271 00:36:00,590 --> 00:36:02,770 This is how it sounds. 272 00:36:24,800 --> 00:36:27,920 So yeah, that's how it sounds. 273 00:36:27,920 --> 00:36:34,700 Okay, so if you record this, you can decode it. 274 00:36:35,380 --> 00:36:43,260 So there are already built tools, like Multimon, that can decode a lot of AFSK protocols. 275 00:36:43,260 --> 00:36:48,480 So if you record this, you can decode it and you can see the message we saw at the beginning. 276 00:36:48,480 --> 00:37:01,360 So I am marking in red, because I told you, the standard says that you have to have two equal bits, so you can take this bit as valid. 277 00:37:01,680 --> 00:37:10,020 So the message with the first two headers, because it receives and they are equal, this is the end of... 278 00:37:10,560 --> 00:37:16,480 like the final message, the third message, it helps, but it doesn't matter. 279 00:37:16,480 --> 00:37:18,160 You already got the message. 280 00:37:18,640 --> 00:37:26,940 So yeah, you can use it in Multimon to decode this, but yeah, just for the fun, I built my decoder in Python. 281 00:37:27,060 --> 00:37:30,920 So yeah, it's not very difficult, as I was saying. 282 00:37:30,920 --> 00:37:33,220 I use SciPy and NumPy. 283 00:37:33,220 --> 00:37:36,060 It processes the recordings in web format. 284 00:37:36,220 --> 00:37:40,060 I use a band-fan filter and the Groetzel algorithm to detect the tones. 285 00:37:40,060 --> 00:37:51,520 Groetzel algorithm is a type of fast Fourier transformation that you send a little part of the message and it tells you the dominant frequency. 286 00:37:52,080 --> 00:37:57,640 It's synchronized using the preamble detection and applies a sliding window to detect the bit transitions. 287 00:37:58,140 --> 00:38:03,300 And well, it detects the audio attention signal and extracts the message stream. 288 00:38:03,300 --> 00:38:10,840 So yeah, you can see the code there and there is a recording of the same message. 289 00:38:11,820 --> 00:38:16,740 So yeah, a real recording, in fact, the one we heard. 290 00:38:18,120 --> 00:38:22,080 And then, how can you encode this? 291 00:38:22,080 --> 00:38:32,360 I was going to build it, but I decided not to because there was a Python library to do it. 292 00:38:32,360 --> 00:38:37,780 You just input your header and it generates you a web file. 293 00:38:37,780 --> 00:38:41,020 So yeah, it was pretty easy. 294 00:38:41,020 --> 00:38:47,820 So yeah, I decided to build the decoder because decoding is much harder than encoding. 295 00:38:47,820 --> 00:38:50,660 So I decided not to build it. 296 00:38:51,280 --> 00:38:59,100 But well, how can you test if this web file turns on the receiver? 297 00:38:59,100 --> 00:39:00,220 So you can. 298 00:39:00,220 --> 00:39:04,980 Well, you can, but you should not because this is pretty legal in Mexico. 299 00:39:05,440 --> 00:39:07,140 And also here in the U.S. 300 00:39:07,140 --> 00:39:08,240 I think so. 301 00:39:08,900 --> 00:39:24,240 So yeah, in Mexico the law says that it's... I don't know how to say it in English, but the point is that you can... they can send you to jail and ask questions later. 302 00:39:25,300 --> 00:39:30,280 Basically, that's what the law says. 303 00:39:30,280 --> 00:39:41,020 So yeah, it's pretty hard if you transmit on the weather band because it's reserved. 304 00:39:41,380 --> 00:39:47,420 But you can validate if this web, you send it to the decoder and the decoder says the same. 305 00:39:47,420 --> 00:39:50,140 So yeah, you can do it. 306 00:39:50,140 --> 00:40:01,140 If you want to transmit, you know there are SDRs that can transmit on these frequencies or maybe a radio can do it. 307 00:40:01,160 --> 00:40:07,800 You modify it because but yeah, it's pretty easy. 308 00:40:07,820 --> 00:40:09,560 So this is how it looks. 309 00:40:09,740 --> 00:40:12,600 On the top you can see the recording. 310 00:40:12,840 --> 00:40:17,760 You know, there is noise, there is a lot of things, and in the bottom part is the one you generate. 311 00:40:17,760 --> 00:40:21,060 So obviously because you are generating it, it's clean. 312 00:40:21,440 --> 00:40:25,760 But now that you know how it's done, don't do it. 313 00:40:26,640 --> 00:40:40,300 Yeah, yeah, because well, it's punishable by law, but also it's like you play with, you can play with people and it can have implications. 314 00:40:41,580 --> 00:40:43,800 So some final thoughts. 315 00:40:44,940 --> 00:41:11,360 First of all, I think it's very cool that we have like in Mexico the series, even with the bad parts that they have, like it's, I think it's, we must be proud in Mexico that they build this technology, that it works, and yeah, it's something that only applies to Mexico. 316 00:41:11,360 --> 00:41:17,440 It's one of, because the seismics came from far away from the city, they can do this. 317 00:41:17,660 --> 00:41:23,360 And well, the NOAA weather radio, I think it's also a cool system here for the U.S. 318 00:41:24,220 --> 00:41:34,380 I'm glad we have this kind of organization that build this kind of technology to help save lives of people. 319 00:41:35,720 --> 00:41:39,320 So there are advantages and improvement areas about this. 320 00:41:39,660 --> 00:41:42,780 So first, advantages, the simplicity. 321 00:41:42,800 --> 00:41:52,040 As you saw, you need only a receiver that can decode some AFSK signals, so it's simple. 322 00:41:52,180 --> 00:41:55,100 Interoperability, so it's an open standard. 323 00:41:55,120 --> 00:42:00,220 You can build receivers, you can do it with your own. 324 00:42:00,220 --> 00:42:05,600 It's efficient, you saw the message is small, and it goes to the point. 325 00:42:07,070 --> 00:42:22,920 Resilience, so yeah, it works fine in rural areas, remote areas, so you have like, you saw like 15 receivers and you cover like 30 million people in Mexico. 326 00:42:23,280 --> 00:42:25,060 So yeah, it's resilient. 327 00:42:25,060 --> 00:42:35,080 And well, it's a standard, so yeah, you can save on training, and all that kind of stuff. 328 00:42:35,080 --> 00:42:40,100 But improvement areas, so the first one is lack of origin verification, right? 329 00:42:40,760 --> 00:42:46,640 Anybody can transmit these signals and nobody can verify its origin. 330 00:42:46,880 --> 00:42:57,820 Message tampering, it's almost the same, like anybody can alter the signal, like you can or change something. 331 00:42:57,940 --> 00:42:59,340 Interference or jamming. 332 00:42:59,340 --> 00:43:14,400 So yeah, I think with any wireless system, you can do some interference, some jamming, but there is no channel jump or something like that, no. 333 00:43:14,400 --> 00:43:16,820 It's just a fixed channel. 334 00:43:17,340 --> 00:43:19,220 Dependence on specialized hardware. 335 00:43:19,220 --> 00:43:26,560 Obviously you need a receiver that can synchronize these frequencies and interpret it. 336 00:43:26,740 --> 00:43:28,960 And well, language limitations, obviously. 337 00:43:28,960 --> 00:43:38,240 You can only transmit a voice message in one language, so you have to choose one, like here in the U.S. 338 00:43:38,240 --> 00:43:40,280 there are people that speak a lot of languages. 339 00:43:40,280 --> 00:43:49,040 So I think that what you do here is you have frequencies for one language and another ones for another language, but it's not ideal. 340 00:43:50,040 --> 00:43:53,300 So, what's beyond these systems? 341 00:43:53,300 --> 00:44:02,240 First is the Common Alerting Protocol, that is a system that is designed to have signatures. 342 00:44:02,520 --> 00:44:11,480 It's an XML protocol, so it has overcome a lot of the improvement areas we saw. 343 00:44:11,480 --> 00:44:14,780 And well, I already mentioned this, Cell Broadcast. 344 00:44:16,200 --> 00:44:39,700 It's part of the GSM protocol, so it lives in lower layers, so it doesn't matter if there is network congestion or whatever, or even if you don't have the data on your SIM card, you should receive the message. 345 00:44:40,660 --> 00:44:45,900 But yeah, in Mexico there is a tough time making this work. 346 00:44:46,380 --> 00:44:55,220 And in fact, I think today or yesterday, they were just going to send another alert to see if it worked this time. 347 00:44:56,720 --> 00:45:00,840 So yeah, that's all. 348 00:45:00,840 --> 00:45:04,140 I'm very grateful for you for being here. 349 00:45:04,300 --> 00:45:08,840 So please, if you want to connect, I am Manuel Rabade on social networks. 350 00:45:08,840 --> 00:45:10,480 You can drop me an email. 351 00:45:10,660 --> 00:45:16,320 You can visit my webpage when I write about technology and other stuff. 352 00:45:17,240 --> 00:45:27,100 I also invite you to follow the RF Village, the Mexican version, that was inspired by things like this. 353 00:45:27,420 --> 00:45:46,820 So yeah, if you come to Mexico City to a security event, maybe we will be there, or if you want to go and do some tourism in Mexico City, we can hang out a little bit and let you know what you have to do in case of an earthquake. 354 00:45:49,060 --> 00:45:53,700 And I really want to finish this with a question. 355 00:45:53,700 --> 00:45:57,860 How do we balance accessibility, interoperability and security? 356 00:45:57,900 --> 00:46:04,920 Because, well, doing software or doing whatever, at the end it's a balance of these. 357 00:46:05,820 --> 00:46:08,500 So yeah, it's a very interesting question. 358 00:46:08,500 --> 00:46:10,880 How can you secure these systems? 359 00:46:10,880 --> 00:46:17,500 Because if you add a security layer, you also are adding a part that can fail. 360 00:46:17,500 --> 00:46:21,740 And if it fails, it can stop alerting people. 361 00:46:21,740 --> 00:46:26,540 So yeah, it's like... there is a balance. 362 00:46:26,560 --> 00:46:29,160 There's no right answer how to tackle this. 363 00:46:29,160 --> 00:46:30,680 So yeah. 364 00:46:30,760 --> 00:46:35,300 So thank you very much for everybody and have a great day.