Code Monkey home page Code Monkey logo

gr-amps's Introduction

Introduction

gr-amps is a set of blocks that implement many of the features of an AMPS base station. The included flowgraph (ampsbs.grc) is essentially a BS-in-a-box.

This is a work in progress, and is an experimental/research tool. Expect occurrences of poor code quality, unreliability, and general brokenness.

It requires IT++ and gnuradio 3.7.x.

WARNING

Using this to transmit over the air could potentially disrupt legitimate transmissions and/or devices. It may also be against local laws. Please be sure you are not interfering with anything; if you're not sure, use only in a shielded environment (or via direct cable connection, without an antenna).

When using this tool, it is your responsibility to prevent bad things from happening.

The Blocks

AMPS FOCC (forward control channel)

This block generates a stream of Manchester symbols (two symbols per bit) that can be modulated to form a 10k bit/s FOCC.

FOCC parameters are all hardcoded at the moment; see focc_impl::make_superframe in lib/focc_impl.cc to see the layout of the overhead message train. The parameters it uses are:

  • SID = 00016
  • DCC = 0
  • AUTH = 0
  • S (send serial number) = 0
  • E (extended address field) = 0
  • BIS = 0 (ignore the busy/idle bits)

This configuration is the most straightforward, because it doesn't involve any authentication challenge-response overhead (currently unimplemented) or encryption (likewise). This also means it's the least secure (by 1990s standards), since the phone's ESN is sent for every request.

This block contains changeable busy/idle bits; however, the global variable controlling them is currently always set to idle (and never changed by any other block). This is a work in progress; for testing use, this is just fine since BIS=0 is in effect and therefore the phones ignore it.

AMPS RECC (reverse control channel)

This block receives a stream of Manchester-encoded symbols (two symbols per bit) and looks for RECC seizures and bits following it that may contain a message.

After a potential message is received, it is sent to the AMPS RECC Decode block for processing.

AMPS RECC Decode

This block does the work of decoding and analyzing potential RECC messages. It has limited functionality so far, but as of now it can handle origination (i.e. phone dials a number) and page response messages. In the case of origination, it routes the MS (via the FOCC block) to channel 356 and sends a page to the dialed address. In the case of page response, it routes the MS to 355 and instructs the FVC of 355 to alert briefly, so the phone rings.

AMPS FVC (forward voice channel)

This block generates a stream of Manchester symbols (two symbols per bit) that can be modulated to form a 10k bit/s FVC.

Unlike the FOCC, which transmits data continuously, the FVC operates on a blank-and-burst basis; when the SAT for the channel is transmitted, it's in audio mode. When the SAT is not present, the MS will listen for FVC data words. This block only generates the bursts (repeating them over and over); additional logic is required to create a properly-operating FVC.

AMPS Command Processor

This block takes in PDUs consisting of text-based commands (e.g. from a GR Socket PDU block) and executes them. Supported commands are:

  • fvc off: Disables the data on FVC 355 and enables the audio stream
  • fvc on: Enables the data on FVC 355 and disables the audio stream
  • fvc alert: Change the message on the AMPS FVC block to an alert order word
  • page NPANNNNNNN: Pages the given number

The Flowgraph

The ampsbs.grc flowgraph ties these all together, broadcasting an FOCC on channel 354 (the last control channel for system B). A correspodning RECC is set up to listen for messages from MSes.

Two FVCs are set up - one on 355 with a corresponding RVC and one on 356. The same audio stream (played from a wav file) is sent to both of them. The RECC Decode block sends mobile-originated calls to 356, and calls from pages to 355.

ampsbs.grc targets the USRP (it was developed using an N210); but nothing about the graph or this code is particularly USRP-specific, and other devices may be used. (The FOCC block has been successfully used with a HackRF sink, for example.)

Credits

This code was written by Brandon Creighton ([email protected]).

Shout Outs

  • Pinguino, for the socks
  • Eliot and Bob, for phones
  • cnelson for idea-bouncing
  • Ninja Networks

License

This code is in the public domain. However, be aware that many of its dependencies, including GNU Radio and IT++, are not.

References

gr-amps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gr-amps's Issues

cannot build for gnuradio 3.8.1.0

Well i adjusted the cmake conf and edited 3.7.2 to 3.8.1.0
cmake finds everything but when it comes to building with make
this error shows up for libgnuradio-amps.so
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::from_uint64(unsigned long)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to log4cpp::Appender::AppenderMapStorageInitializer::~AppenderMapStorageInitializer()'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::unset_processor_affinity()' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::fixed_rate_ninput_to_noutput(int)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::general_work(int, std::vector<int, std::allocator<int> >&, std::vector<void const*, std::allocator<void const*> >&, std::vector<void*, std::allocator<void*> >&)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::to_long(boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::msg_accepter::post(boost::shared_ptr<pmt::pmt_base>, boost::shared_ptr<pmt::pmt_base>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::basic_block::message_port_register_in(boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::sync_block::sync_block(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::shared_ptr<gr::io_signature>, boost::shared_ptr<gr::io_signature>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::cdr(boost::shared_ptrpmt::pmt_base const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::cons(boost::shared_ptr<pmt::pmt_base> const&, boost::shared_ptr<pmt::pmt_base> const&)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::blob_length(boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::make_dict()' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::stop()'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::io_signature::make(int, int, int)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::eqv(boost::shared_ptrpmt::pmt_base const&, boost::shared_ptrpmt::pmt_base const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to log4cpp::Appender::AppenderMapStorageInitializer::AppenderMapStorageInitializer()' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::log_levelabi:cxx11'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::from_long(long)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to typeinfo for gr::sync_block'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gnuradio::detail::sptr_magic::fetch_initial_sptr(gr::basic_block*)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::basic_block::message_port_pub(boost::shared_ptrpmt::pmt_base, boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::consume_each(int)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::dict_has_key(boost::shared_ptrpmt::pmt_base const&, boost::shared_ptrpmt::pmt_base const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::operator<<(std::ostream&, boost::shared_ptr<pmt::pmt_base>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::to_uint64(boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::make_tuple(boost::shared_ptr<pmt::pmt_base> const&, boost::shared_ptr<pmt::pmt_base> const&, boost::shared_ptr<pmt::pmt_base> const&, boost::shared_ptr<pmt::pmt_base> const&)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::sync_block::fixed_rate_ninput_to_noutput(int)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to vtable for gr::sync_block' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::tuple_ref(boost::shared_ptrpmt::pmt_base const&, unsigned long)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::~block()' /usr/bin/ld: libgnuradio-amps.so: undefined reference to typeinfo for gr::basic_block'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to typeinfo for gr::block' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::block(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, boost::shared_ptrgr::io_signature, boost::shared_ptrgr::io_signature)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::basic_block::message_port_register_out(boost::shared_ptr<pmt::pmt_base>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::make_tuple(boost::shared_ptrpmt::pmt_base const&, boost::shared_ptrpmt::pmt_base const&, boost::shared_ptrpmt::pmt_base const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::set_processor_affinity(std::vector<int, std::allocator<int> > const&)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::start()'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::set_log_level(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::u8vector_elements(boost::shared_ptrpmt::pmt_base)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::init_u8vector(unsigned long, unsigned char const*)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::forecast(int, std::vector<int, std::allocator >&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::blob_data(boost::shared_ptr<pmt::pmt_base>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::string_to_symbol(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::from_bool(bool)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::make_blob(void const*, unsigned long)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::make_tuple(boost::shared_ptr<pmt::pmt_base> const&, boost::shared_ptr<pmt::pmt_base> const&)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::sync_block::fixed_rate_noutput_to_ninput(int)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::block::fixed_rate_noutput_to_ninput(int)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to gr::sync_block::general_work(int, std::vector<int, std::allocator >&, std::vector<void const*, std::allocator<void const*> >&, std::vector<void*, std::allocator<void*> >&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::is_u8vector(boost::shared_ptr<pmt::pmt_base>)' /usr/bin/ld: libgnuradio-amps.so: undefined reference to pmt::length(boost::shared_ptrpmt::pmt_base const&)'
/usr/bin/ld: libgnuradio-amps.so: undefined reference to `gr::sync_block::forecast(int, std::vector<int, std::allocator >&)'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/CMakeFiles/test-amps.dir/build.make:121: lib/test-amps] Error 1
make[1]: *** [CMakeFiles/Makefile2:277: lib/CMakeFiles/test-amps.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Is it possible to disable test-amps to bypass this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.