networking question: 2-way messaging w/o wireless modem config?

H

haiticare2011

I have a Raspberry Pi board with a wireless usb modem on it.
I wish to be able to message 2-way with the board from
across the internet, without having to open ports on the wireless modem. Is there
a way to do this? I have been looking at udp, but imagine that a udp packet is
allowed in, but not out?
The amount of data transmission I want is very small, maybe lt 30 bytes.
So a client http request could include this data?
I have been looking at messaging systems like MQTT as well, but don't know if they require opening a port in the typical modem-router.

Any ideas appreciated!
 
M

Mark H Harris

I have a Raspberry Pi board with a wireless usb modem on it.
I wish to be able to message 2-way with the board from
across the internet, without having to open ports on the wireless modem. Is there
a way to do this? I have been looking at udp, but imagine that a udp packet is
allowed in, but not out?
The amount of data transmission I want is very small, maybe lt 30 bytes.

The answer depends on how you setup your wireless modem | router. There
are many ways to set this up depending on your project goals. If you're
trying to setup a sniffer (well, just don't do that, its not nice).

If you were trying to setup a micro server on my network (for instance),
well, you couln't, because I don't permit the outgoing connection
without authorization and port (actually, same is true for incoming
connections. I would have to setup auth and port for you to connect your
Pi as a micro server on my wireless network. Most public access points
are blocked (peer to peer) too (if they're smart).

For legitimate non trivial setups (not experiments) you want to control
the connection with auth and ports.

A word of caution about udp. If the data you are sending is contained in
one datagram (one packet), then no problem; however, if you are sending
multiple packets over the WAN it can be a big problem because the upd
in|out does not guarantee correct packet ordering.

Is there a python question in here somewhere?

marcus
 
H

haiticare2011

The answer depends on how you setup your wireless modem | router. There

are many ways to set this up depending on your project goals. If you're

trying to setup a sniffer (well, just don't do that, its not nice).



If you were trying to setup a micro server on my network (for instance),

well, you couln't, because I don't permit the outgoing connection

without authorization and port (actually, same is true for incoming

connections. I would have to setup auth and port for you to connect your

Pi as a micro server on my wireless network. Most public access points

are blocked (peer to peer) too (if they're smart).



For legitimate non trivial setups (not experiments) you want to control

the connection with auth and ports.



A word of caution about udp. If the data you are sending is contained in

one datagram (one packet), then no problem; however, if you are sending

multiple packets over the WAN it can be a big problem because the upd

in|out does not guarantee correct packet ordering.



Is there a python question in here somewhere?



marcus

Thanks - I am just trying to design a consumer product where the consumer
does not have to fiddle with their modem, ie, plug'n'play. Usually, with
consumer modems, you can do http client activity. (just connect another PC to
the local network.) So I guess I could iniate a http request from the Pi. I
just wondered if there were other protocols that would allow me to just
communicate with the Pi.

As far as sniffers etc., I adhere to a complete personal honesty - that's my
policy, as anything else just won't do. I hope to program the item in Python,
though I'm wondering if C is better for network programming.

Thanks for help.
jb
 
C

Chris Angelico

As far as sniffers etc., I adhere to a complete personal honesty - that's my
policy, as anything else just won't do. I hope to program the item in Python,
though I'm wondering if C is better for network programming.

Not at all. I'd definitely recommend doing networking code in Python.
You can do basic TCP/IP sockets pretty much the same way in every
language, but with high level languages like Python, you get extra
facilities that C won't give - most notably, the urllib.request module
[1]. Same goes for quite a few other high level protocols. Take the
easy way out!

ChrisA

[1] https://docs.python.org/3/library/urllib.request.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top