WEBVTT

00:04.060 --> 00:06.700
Well, hello everybody.

00:06.700 --> 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.

00:16.400 --> 00:18.860
Thank you very much for coming in.

00:19.800 --> 00:23.400
I'm very happy to present this.

00:23.940 --> 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.

00:35.000 --> 00:46.000
So we are going to explore how they work, their limitations, and why everybody can generate these signals.

00:48.780 --> 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.

01:01.700 --> 01:09.860
The curiosity to understand how things work, explore their boundaries, and share that information.

01:11.140 --> 01:18.800
So what we are going to talk about first, we are going to talk about the Mexican seismic alert system.

01:21.960 --> 01:28.680
Radio frequency plays a key role here, not only for sending the alerts, but for the core of the system.

01:28.680 --> 01:31.540
It's something like pretty interesting.

01:32.440 --> 01:37.660
We are going to talk then about the EAS same system.

01:38.520 --> 01:44.580
This is the system that works here in the US to transmit alerts.

01:44.920 --> 01:50.740
We are going to see how it works, how the messages are sent, how they are encoded.

01:51.860 --> 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.

02:01.020 --> 02:08.780
And then we will wrap up with some final thoughts about the performance of these systems.

02:11.740 --> 02:14.700
First of all, a little bit about me.

02:14.700 --> 02:18.720
I started learning computers and electronics in the 90s.

02:18.720 --> 02:23.000
I was very heavily involved in the post-community in the 2000s.

02:23.000 --> 02:31.240
At the same time I studied computer engineering at the Autonomous National University of Mexico.

02:32.100 --> 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.

02:41.460 --> 02:45.780
Recently I have been collaborating with RF Villaje Mexico.

02:45.880 --> 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.

02:57.480 --> 03:02.880
We are doing something like CTF, talks, and well.

03:02.880 --> 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.

03:20.000 --> 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.

03:31.940 --> 03:37.420
So this story begins in 1985.

03:37.560 --> 03:42.620
We had like a very big earthquake in Mexico City.

03:43.600 --> 03:48.940
At that time there were 10 million people in Mexico City.

03:48.940 --> 03:59.060
And, well, there were about 40,000 casualties.

03:59.060 --> 04:11.340
So this was big, like about 400 buildings collapsed, 100,000 homes were affected.

04:11.340 --> 04:20.960
So yeah, this mark, like from my generation to older ones, like everybody talks about the 1985 earthquake.

04:21.540 --> 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.

04:29.400 --> 04:33.640
My grandparents used to live in the one that's still standing.

04:33.680 --> 04:35.200
So yeah, it was pretty scary.

04:35.560 --> 04:43.060
Their home was not demolished, but it was demolished later because the building was not any more usable.

04:43.060 --> 04:47.540
So earthquakes are a big thing in Mexico City.

04:47.980 --> 04:54.140
So why is Mexico City so affected by earthquakes?

04:54.200 --> 04:56.460
There are two reasons.

04:56.460 --> 05:04.320
The first reason is the city is built in a lake bed.

05:04.840 --> 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.

05:19.400 --> 05:24.300
So on the right of that, it's a picture of almost the same perspective.

05:24.300 --> 05:27.620
You see there is no lake anymore.

05:27.680 --> 05:33.680
So the problem with this is that the soil amplifies the earthquake.

05:34.240 --> 05:37.180
The earthquake is very soft.

05:37.340 --> 05:44.220
So that's the first reason why Mexico City is very heavy affected by earthquakes.

05:44.220 --> 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.

05:55.520 --> 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.

06:08.540 --> 06:17.380
So that's the two reasons like Mexico and Mexico City, it's very prone to have big earthquakes.

06:18.960 --> 06:25.240
Yeah, like, we have like, each year we have between 10 and 20 earthquakes.

06:25.440 --> 06:27.760
Small ones and medium ones.

06:27.760 --> 06:28.720
Well, not small.

06:28.720 --> 06:30.320
Medium and strong.

06:30.320 --> 06:34.420
And each year we have between one and three strong ones.

06:34.640 --> 06:40.200
And one time each, in 10 years, we have a very strong one.

06:40.220 --> 06:42.380
Like the 1985 one.

06:42.620 --> 06:47.740
So the last big one was in 2017.

06:47.940 --> 06:50.100
Some buildings collapsed.

06:50.100 --> 06:52.960
It was not as hard as 1985.

06:53.220 --> 06:55.280
But yeah, we have casualties.

06:55.980 --> 06:58.560
And well, it was hard.

06:58.980 --> 07:03.060
So after 1985, what happened?

07:03.060 --> 07:06.700
Some scientists, engineers, came.

07:06.700 --> 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.

07:20.820 --> 07:30.500
So the earthquake was, 1985, was originated in, you see the little star there.

07:30.520 --> 07:35.820
So it was generated 390 kilometers away from Mexico City.

07:35.820 --> 07:45.820
And Mexico City is, you can see like the yellow spot and orange in the middle of the country.

07:45.820 --> 07:59.900
So the earthquake is 390 kilometers away, but seismic waves travel at about 4.5 kilometers per second.

08:00.120 --> 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.

08:09.120 --> 08:18.960
So what happens, because well, and they see, OK, the radio frequency, what the speed is about 300 kilometers per second.

08:19.060 --> 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.

08:31.720 --> 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.

08:42.180 --> 08:46.600
But when they see we have this big earthquake, we can do this.

08:47.260 --> 08:59.560
So in 86, Mexico City government, federal government, all the governments, founded the Center for Seismic Implementation and Recording.

08:59.560 --> 09:01.480
The CIRES.

09:01.540 --> 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.

09:13.220 --> 09:19.980
And they proposed this system we see on the right of the screen.

09:19.980 --> 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.

09:38.520 --> 09:48.540
And if the seismic activity was worth enough, to send an alert to all the population in Mexico City.

09:49.020 --> 09:54.920
So they developed this system that was activated in 91.

09:56.480 --> 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.

10:14.940 --> 10:19.340
Like... Yeah, something like that.

10:19.340 --> 10:27.240
They invented this sound, and well, this... What happened?

10:27.240 --> 10:34.620
In 93, I think it was the first seismic event that was alerted.

10:34.620 --> 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.

10:53.060 --> 10:58.180
And well, CIRES is an academic engineering organization.

10:58.180 --> 11:01.660
It has a lot of scientific and outreach publications.

11:01.660 --> 11:02.640
Very interesting.

11:02.640 --> 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.

11:17.900 --> 11:18.840
Okay?

11:19.300 --> 11:24.580
So this is the Mexican Seismic Alert, how it works.

11:24.580 --> 11:28.220
You have the sensor stations on the coast.

11:28.220 --> 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.

11:41.340 --> 11:42.860
Well, it's not published.

11:43.520 --> 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,

12:06.260 --> 12:09.880
you will lose the fear of this alert.

12:10.000 --> 12:10.340
Yeah?

12:10.340 --> 12:13.780
So they take it, like, very seriously.

12:13.880 --> 12:16.040
So this central station is connected.

12:16.040 --> 12:24.160
I don't know how, that's the question I'm asking, to several systems to broadcast this alert.

12:24.160 --> 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.

12:37.260 --> 12:45.360
Also, it was sent to radio stations, to television at the beginning.

12:45.920 --> 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.

12:55.100 --> 13:03.740
So in 2008, they start installing the EAS, same transmitter network.

13:04.760 --> 13:09.260
This was 2008, like, not so long ago, we will see.

13:09.260 --> 13:14.180
And they start to install receivers for this in government buildings.

13:14.180 --> 13:18.820
They started with government buildings, and then commercial buildings.

13:18.860 --> 13:26.840
And well, that's why the red square is there, because that's what we will be talking about, right?

13:26.840 --> 13:32.860
We will be talking about all the other systems, like, I talk about it because I think it's cool.

13:33.320 --> 13:39.620
I'm really happy that we have this, but now we are going to talk about these networks.

13:40.100 --> 13:43.280
They are also testing the self-broadcast.

13:44.340 --> 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.

13:57.620 --> 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.

14:09.220 --> 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.

14:19.480 --> 14:22.380
There are drills two times a year about this.

14:22.380 --> 14:24.040
So yeah, it's a pretty big deal.

14:25.860 --> 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.

14:38.300 --> 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.

14:48.020 --> 14:50.920
So yeah, like, people, it's pretty aware.

14:50.920 --> 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.

15:00.180 --> 15:04.480
And you will know how it will hit in a couple of minutes.

15:04.840 --> 15:06.520
Not so long.

15:07.220 --> 15:07.840
Okay?

15:08.720 --> 15:18.400
So yeah, just to wrap up, you can see on the left, it's the current state of the sensors.

15:18.580 --> 15:22.060
We start with 12 sensors in Mexico.

15:22.060 --> 15:23.440
There are a lot of more.

15:23.440 --> 15:25.620
They are expanding this system.

15:25.960 --> 15:31.600
And on the right, it's the network of transmitters we have in Mexico.

15:31.600 --> 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.

15:43.240 --> 15:52.980
So like, 30 million of people depends on this system to get alerts about this kind of danger.

15:52.980 --> 16:03.320
So even if, as we are going to see, it's an old system, it's pretty relevant still.

16:03.320 --> 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.

16:13.800 --> 16:16.900
Something like that we have with these systems.

16:16.900 --> 16:18.700
Yeah, they don't die.

16:18.700 --> 16:24.960
Yeah, so where was the aha moment for me?

16:25.040 --> 16:33.680
You can see on the left, this is the transmitters that were being installed first on government buildings.

16:33.680 --> 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.

16:54.500 --> 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.

17:12.680 --> 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.

17:21.300 --> 17:29.120
So I bought some breakout boards and well, I built my receiver.

17:29.280 --> 17:39.100
So yeah, in 2010s, what you do when you start receiving something cool, you build a Twitter box.

17:39.100 --> 17:52.980
So yeah, it was popular to get on Twitter the alerts, so I published a project, SeismoAlerta, like seismic alert.

17:53.180 --> 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.

18:05.960 --> 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.

18:18.760 --> 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,

18:44.920 --> 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.

18:58.080 --> 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,

19:23.200 --> 19:32.980
so there was no way to make one receiver, or to make it comply with the law.

19:32.980 --> 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.

19:52.860 --> 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.

20:10.720 --> 20:14.620
We are going to see what they changed later.

20:14.960 --> 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.

20:30.140 --> 20:36.800
And well, I'm very happy, because I know at least one of these companies is using the software I published.

20:36.880 --> 20:38.660
Yeah, I know for the developers.

20:39.600 --> 20:52.200
It's cool to have help to build this small ecosystem of entrepreneurs around this in Mexico City.

20:53.860 --> 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.

21:11.100 --> 21:18.880
I also published it, as you know, any dissertation about a degree in Mexico has to be published.

21:19.720 --> 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.

21:28.400 --> 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,

22:01.100 --> 22:02.100
right?

22:02.460 --> 22:07.340
So yeah, that's where this idea, this talk, it was born.

22:10.020 --> 22:16.320
So, we are going to jump to talk about the EAS, same system.

22:16.320 --> 22:21.100
I don't know how many of you know what it is, can you raise your hand?

22:22.360 --> 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.

22:33.160 --> 22:41.140
I know it's useful here, but for certain areas that are prone to certain dangers.

22:42.160 --> 22:45.760
So what is the EAS?

22:45.760 --> 22:51.260
The EAS is short for Emergency Alert System, and it's a system nationwide here in the U.S.

22:51.260 --> 22:56.160
to notify the public about natural disasters, security threats, or civilian emergencies.

22:56.400 --> 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.

23:09.860 --> 23:12.800
So that's the EAS, same system.

23:13.140 --> 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.

23:24.680 --> 23:32.820
So they were transmitting it in 162.55 megacycles, not megahertz, megacycles.

23:32.820 --> 23:34.680
It's cool to know that.

23:35.000 --> 23:43.440
So yeah, this was a frequency VHF that they were transmitting like just a weather report.

23:43.980 --> 23:50.420
It's not FM radio, it's a little bit different, a little bit higher, but it's the same.

23:50.420 --> 23:54.120
They were transmitting voice messages about the forecast.

23:56.820 --> 24:00.020
So yeah, so this system started evolving.

24:00.300 --> 24:04.620
Like I say, in the 60s, the weather information broadcast in the U.S.

24:04.620 --> 24:10.780
In the 70s, in 71, they introduced the warning alarm tone.

24:10.780 --> 24:18.100
It was a tone that was made for... you didn't have to have your receiver on all the time.

24:18.120 --> 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.

24:29.960 --> 24:32.700
So that's the warning alarm tone.

24:32.880 --> 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.

24:50.500 --> 24:57.880
So what I'm trying to clarify here is things move slow with this kind of systems.

24:57.880 --> 25:00.120
It's not very fast.

25:00.600 --> 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.

25:15.280 --> 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.

25:30.580 --> 25:36.340
NOAA weather radio, it covers 90% of the 50 U.S.

25:36.340 --> 25:38.240
states, as you can see.

25:38.240 --> 25:44.520
In Mexico, it covers just the center part, but we have only like 15.

25:44.740 --> 25:52.480
You have over 750 transmitters.

25:52.640 --> 25:55.060
It's a pretty big network.

25:55.940 --> 26:01.000
So yeah, this is where the fun begins.

26:01.600 --> 26:04.600
So how it works, NOAA weather radio.

26:04.600 --> 26:08.900
So on the right, there is the table of the channels, the frequencies.

26:08.920 --> 26:13.260
As you can see, the first frequency on the table is the same from the 60s player.

26:13.540 --> 26:15.740
So yeah, they continue to use it.

26:15.740 --> 26:17.800
They haven't changed it.

26:17.800 --> 26:19.260
Well, I understand it.

26:19.260 --> 26:20.660
Why did you change it?

26:22.380 --> 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.

26:29.520 --> 26:34.180
So in theory, if you have a 60s radio, it should still work.

26:35.820 --> 26:44.680
So yeah, the range of this transmitter is up to 40 miles on flat terrain.

26:44.680 --> 26:47.360
And well, the modulation is wide FM.

26:47.540 --> 26:51.560
It's wide FM modulation like any radio modulation.

26:52.000 --> 26:57.440
So yeah, and well, what about the same protocol?

26:57.440 --> 27:08.680
The same protocol, these are like digital broadcasts that you hear on these channels.

27:08.680 --> 27:13.860
On AF-SK modulation, audio frequency shift key.

27:14.020 --> 27:19.660
So yeah, they have a bit period of 1.92 milliseconds.

27:19.660 --> 27:30.020
That will be like about 50, yes, it's 520 bytes per second you can send.

27:30.080 --> 27:33.840
Yeah, there you see the logical 0, logical 1.

27:33.840 --> 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.

27:48.140 --> 27:57.320
And well, the characters are encoded in ASCII, so the less significant bit is sent first.

27:58.920 --> 28:00.820
And well, that's all.

28:00.820 --> 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.

28:12.340 --> 28:18.440
So on the right is the structure of one message.

28:18.440 --> 28:20.780
It's composed of four sections.

28:20.960 --> 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.

28:30.580 --> 28:35.420
So the header is where all the information about the alert is sent.

28:36.880 --> 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.

28:52.240 --> 29:01.500
So as you can see, there is no error correction, so the receiver has to do it from the repetitions.

29:01.580 --> 29:11.740
And well, each header, it sends a preamble, then the header, a pause, and then another two.

29:12.820 --> 29:16.700
So let's see, well, this is the header.

29:16.700 --> 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

29:33.040 --> 29:36.320
area message encoding, that's the area part.

29:36.320 --> 29:39.560
They can send several of these codes.

29:39.560 --> 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.

29:53.620 --> 30:00.520
But why do I care if the alert is from the city on the other side of the hill?

30:00.520 --> 30:09.040
So you can configure your code area to your receiver and ignore alerts that don't match your receiver.

30:09.320 --> 30:14.960
So they also send expiration time and the issue date and time, and the transmitter ID.

30:15.120 --> 30:19.880
So this is the information they are sending in one of these headers.

30:20.040 --> 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.

30:35.660 --> 30:39.620
So yeah, it's very simple.

30:40.880 --> 30:45.240
So, well, and how they implement it in Mexico.

30:45.240 --> 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.

30:53.380 --> 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.

31:07.080 --> 31:11.380
And then we have a technical standard, which is the standard about this.

31:11.420 --> 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.

31:25.740 --> 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.

31:40.780 --> 31:45.940
So you must check your antenna installation and so on.

31:46.160 --> 31:54.080
And then, their quick warning, the EQWB, it's sent three times.

31:54.300 --> 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.

32:10.200 --> 32:13.100
So they take out the voice message.

32:13.100 --> 32:16.260
So now, if you bought a U.S.

32:16.260 --> 32:20.440
receiver, it doesn't work in Mexico for this alert.

32:20.440 --> 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.

32:35.780 --> 32:45.960
market because the price of an official receiver, they are 20% the price of an official receiver.

32:45.960 --> 32:53.940
So they were very cheap, and people were buying these and there was a market, but they were not officially recognized.

32:54.020 --> 32:59.460
So yeah, we can gossip about that.

33:00.000 --> 33:04.380
There is a lot to say about it.

33:05.280 --> 33:10.380
So let's see how can you receive the code and encode these messages.

33:10.440 --> 33:13.560
So that's the fun part, the theory.

33:13.860 --> 33:17.100
In practice, how can you receive these messages?

33:17.720 --> 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.

33:30.460 --> 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.

33:50.540 --> 33:52.120
I used the same one.

33:52.120 --> 33:57.580
It's a solution in one chip that tunes the code and does everything.

33:58.000 --> 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.

34:12.620 --> 34:15.560
So this is with SDR++.

34:15.880 --> 34:19.160
How do you see it in Mexico City?

34:19.640 --> 34:30.440
At least in my apartment, I get like three or four very strong signals about the weather radio.

34:30.440 --> 34:33.580
You can see it on the right.

34:33.580 --> 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.

34:50.020 --> 34:56.420
So I'm going to play what you hear on this audio channel.

34:57.280 --> 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.

35:12.990 --> 35:16.730
If you tune to one of these frequencies.

35:16.930 --> 35:18.710
So yeah, it's very easy.

35:21.450 --> 35:27.230
And then here we see the moment that they send these text messages.

35:27.230 --> 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.

35:41.590 --> 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.

36:00.590 --> 36:02.770
This is how it sounds.

36:24.800 --> 36:27.920
So yeah, that's how it sounds.

36:27.920 --> 36:34.700
Okay, so if you record this, you can decode it.

36:35.380 --> 36:43.260
So there are already built tools, like Multimon, that can decode a lot of AFSK protocols.

36:43.260 --> 36:48.480
So if you record this, you can decode it and you can see the message we saw at the beginning.

36:48.480 --> 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.

37:01.680 --> 37:10.020
So the message with the first two headers, because it receives and they are equal, this is the end of...

37:10.560 --> 37:16.480
like the final message, the third message, it helps, but it doesn't matter.

37:16.480 --> 37:18.160
You already got the message.

37:18.640 --> 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.

37:27.060 --> 37:30.920
So yeah, it's not very difficult, as I was saying.

37:30.920 --> 37:33.220
I use SciPy and NumPy.

37:33.220 --> 37:36.060
It processes the recordings in web format.

37:36.220 --> 37:40.060
I use a band-fan filter and the Groetzel algorithm to detect the tones.

37:40.060 --> 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.

37:52.080 --> 37:57.640
It's synchronized using the preamble detection and applies a sliding window to detect the bit transitions.

37:58.140 --> 38:03.300
And well, it detects the audio attention signal and extracts the message stream.

38:03.300 --> 38:10.840
So yeah, you can see the code there and there is a recording of the same message.

38:11.820 --> 38:16.740
So yeah, a real recording, in fact, the one we heard.

38:18.120 --> 38:22.080
And then, how can you encode this?

38:22.080 --> 38:32.360
I was going to build it, but I decided not to because there was a Python library to do it.

38:32.360 --> 38:37.780
You just input your header and it generates you a web file.

38:37.780 --> 38:41.020
So yeah, it was pretty easy.

38:41.020 --> 38:47.820
So yeah, I decided to build the decoder because decoding is much harder than encoding.

38:47.820 --> 38:50.660
So I decided not to build it.

38:51.280 --> 38:59.100
But well, how can you test if this web file turns on the receiver?

38:59.100 --> 39:00.220
So you can.

39:00.220 --> 39:04.980
Well, you can, but you should not because this is pretty legal in Mexico.

39:05.440 --> 39:07.140
And also here in the U.S.

39:07.140 --> 39:08.240
I think so.

39:08.900 --> 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.

39:25.300 --> 39:30.280
Basically, that's what the law says.

39:30.280 --> 39:41.020
So yeah, it's pretty hard if you transmit on the weather band because it's reserved.

39:41.380 --> 39:47.420
But you can validate if this web, you send it to the decoder and the decoder says the same.

39:47.420 --> 39:50.140
So yeah, you can do it.

39:50.140 --> 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.

40:01.160 --> 40:07.800
You modify it because but yeah, it's pretty easy.

40:07.820 --> 40:09.560
So this is how it looks.

40:09.740 --> 40:12.600
On the top you can see the recording.

40:12.840 --> 40:17.760
You know, there is noise, there is a lot of things, and in the bottom part is the one you generate.

40:17.760 --> 40:21.060
So obviously because you are generating it, it's clean.

40:21.440 --> 40:25.760
But now that you know how it's done, don't do it.

40:26.640 --> 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.

40:41.580 --> 40:43.800
So some final thoughts.

40:44.940 --> 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.

41:11.360 --> 41:17.440
It's one of, because the seismics came from far away from the city, they can do this.

41:17.660 --> 41:23.360
And well, the NOAA weather radio, I think it's also a cool system here for the U.S.

41:24.220 --> 41:34.380
I'm glad we have this kind of organization that build this kind of technology to help save lives of people.

41:35.720 --> 41:39.320
So there are advantages and improvement areas about this.

41:39.660 --> 41:42.780
So first, advantages, the simplicity.

41:42.800 --> 41:52.040
As you saw, you need only a receiver that can decode some AFSK signals, so it's simple.

41:52.180 --> 41:55.100
Interoperability, so it's an open standard.

41:55.120 --> 42:00.220
You can build receivers, you can do it with your own.

42:00.220 --> 42:05.600
It's efficient, you saw the message is small, and it goes to the point.

42:07.070 --> 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.

42:23.280 --> 42:25.060
So yeah, it's resilient.

42:25.060 --> 42:35.080
And well, it's a standard, so yeah, you can save on training, and all that kind of stuff.

42:35.080 --> 42:40.100
But improvement areas, so the first one is lack of origin verification, right?

42:40.760 --> 42:46.640
Anybody can transmit these signals and nobody can verify its origin.

42:46.880 --> 42:57.820
Message tampering, it's almost the same, like anybody can alter the signal, like you can or change something.

42:57.940 --> 42:59.340
Interference or jamming.

42:59.340 --> 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.

43:14.400 --> 43:16.820
It's just a fixed channel.

43:17.340 --> 43:19.220
Dependence on specialized hardware.

43:19.220 --> 43:26.560
Obviously you need a receiver that can synchronize these frequencies and interpret it.

43:26.740 --> 43:28.960
And well, language limitations, obviously.

43:28.960 --> 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.

43:38.240 --> 43:40.280
there are people that speak a lot of languages.

43:40.280 --> 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.

43:50.040 --> 43:53.300
So, what's beyond these systems?

43:53.300 --> 44:02.240
First is the Common Alerting Protocol, that is a system that is designed to have signatures.

44:02.520 --> 44:11.480
It's an XML protocol, so it has overcome a lot of the improvement areas we saw.

44:11.480 --> 44:14.780
And well, I already mentioned this, Cell Broadcast.

44:16.200 --> 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.

44:40.660 --> 44:45.900
But yeah, in Mexico there is a tough time making this work.

44:46.380 --> 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.

44:56.720 --> 45:00.840
So yeah, that's all.

45:00.840 --> 45:04.140
I'm very grateful for you for being here.

45:04.300 --> 45:08.840
So please, if you want to connect, I am Manuel Rabade on social networks.

45:08.840 --> 45:10.480
You can drop me an email.

45:10.660 --> 45:16.320
You can visit my webpage when I write about technology and other stuff.

45:17.240 --> 45:27.100
I also invite you to follow the RF Village, the Mexican version, that was inspired by things like this.

45:27.420 --> 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.

45:49.060 --> 45:53.700
And I really want to finish this with a question.

45:53.700 --> 45:57.860
How do we balance accessibility, interoperability and security?

45:57.900 --> 46:04.920
Because, well, doing software or doing whatever, at the end it's a balance of these.

46:05.820 --> 46:08.500
So yeah, it's a very interesting question.

46:08.500 --> 46:10.880
How can you secure these systems?

46:10.880 --> 46:17.500
Because if you add a security layer, you also are adding a part that can fail.

46:17.500 --> 46:21.740
And if it fails, it can stop alerting people.

46:21.740 --> 46:26.540
So yeah, it's like... there is a balance.

46:26.560 --> 46:29.160
There's no right answer how to tackle this.

46:29.160 --> 46:30.680
So yeah.

46:30.760 --> 46:35.300
So thank you very much for everybody and have a great day.

