emulate Predictive OLSR protocol on emane - adhoc

In recent weeks, I'm learning to use EMANE to do the emulation about Ad hoc networks which uses the Predictive OLSR routing protocol.
The locations of the UAVs' location are taken into account to calculate the ETX metric in P-OLSR, which makes it different with ordinary OLSR. I get trouble in transferring the locations data of UAVs into the P-OLSR core. The patch file that I downloaded from the link mentioned above adds a gpsreceiver plugin to the protocol, which is used to receive location data from the out of P-OLSR then transfer it into P-OLSR. And in the olsrd.conf.example file, I'm supposed to set an interface, a multicast IP address and a port for the plugin, I don't know how to set these things when I use the EMANE emulation platform. I tried to set the multicast IP address and the port same as the value of eventservicegroup attribute. But the it cannot be right, because the data format is not consistent.
EMANE uses an application called eelgenerator which can generate location event to deliver the locations data of UAVs, but the data is in a eel log file format not in a NMEA format which is wanted by gpsreceiver. EMANE also has an application called gpsd location agent, and it can handle the location event, and transfer the locations data into NMEA format, but the output of gpsd location agent can only be connected to GPSd directly or to a pseudo terminal then connected by GPSd. GPSd can get the latitude, longitude and altitude information from the NMEA format location data, and serves the other applications via the port 2947 of localhost.
So, How can I transfer the locations data into P-OLSR core? If via the gpsreceiver, How should I set the olsrd.conf and do I need to write a program myself? If do not use the gpsreceiver plugin, can I make the P-OLSR core to get location data through GPSd? If can, how to realize that exactly?
PS:the version of my EMANE is emane-0.9.3. the version of my machine's kernel is 4.2.3-300.fc23.x86_64.

I solved the problem. I wrote a python script to read data from the pts and send it to the gpsreceiver. Here is the script:
import socket
fd = open("path of pts", "w+")
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(fd.readline(), (host, port))

Related

how to transmit a location data without using internet?

I would like to send current location of a vehicle to a vehicle presence checking device. In normal case the systems send the location data over GSM Network, but I don't want this because I would like to create a cheap monitoring system. Then I cant use RF transmitter because it transmit data over a few meters. So how to transmit a location data from a gps device to a monitoring device over a 2km distance using wireless data transmission without using internet?
If it is just internet you don't want to use, u can use phone sms to send the co-ordinates in text form.
Otherwise, a point to point network using nano stations,is the only wireless communication that I know can work even to 5km.

Generating requests which appear to be coming from multiple IP's

We are trying to create a simulation script where we need to send TCP packet data to the server in way that it appears to be coming from different IP every time.
Basically we need to emulate multiple devices ( with different IP) which are constantly sending data to the server.
The server creates a new connection only for request coming in from a new IP.
What is the best possible way to achieve it ? Is there a way of using proxy servers or some sort of virtualization to accomplish this ?
What you want to use is IP aliasing. This allows you to create virtual network interfaces. Each virtual interface can have one or more IP addresses assigned to it.
This link shows how to do it in Linux.
This link shows how to do it in Windows.
Next your clients need to specify which of your addresses to use. Use getifaddrs() to enumerate the available addresses. Then use the bind() system call on the socket before you do a connect(). This way you can have multiple clients and each one will use a different source IP address. This post has the details.

switch between video streaming

I am struggling with switching between multiple live streams. For example, I have five live streaming servers streaming(HTTP or RTSP) and I want to put some broker between those (five) streaming sources and destination so that output to the destination would be one video streaming (later I may change the streaming source again using switch). Broker plays role of switcher, My question is, is there such open source "switcher"? Or how this technology works?
here is link to similar question but I want some open source or some brief guidance about how it could be implemented: http://forums.creativecow.net/thread/117/858680
Thank You in advance
That answer can be an archive for the researchers
First Suggestion or Solution(Multicast Router)
You can use a Router or L3 Switch which is support IGMP protocol. That Router or L3 Switch must support IGMP protocol you can structure multicast IP address. You can configure L3 to switch all streaming. Multicast Ip address works within 224.0.0.0 to 239.255.255.255 and works based on device' mac address. You can create different multicast Ip address for the different type of switching scenarios. After finished Router or L3 Switch configuration, you only change IP address to switch streaming into your program. (I didn't mention Broadcast. Broadcast send data to all points. Multicast send data to certain points.)
Second Suggestion or Solution(Programming)
I am using Vlc.Dotnet wrapper for using the Vlc and libvlc libraries. It's open source. RTSP streaming is based on IP address and port number. I don't know any open source switch but you can write one of them for you with use Vlc.dotnet wrapper. You build 5 Streaming server and 1 control server. The Streaming Server's destination should be Control Server's IP. and you can control all data from control server with your basic switch program.
5 Streaming Servers : Sends data to Control server
1 Control Server : Controls and Switches data
I prefer to use Router or L3 Switch for make that. Because it's easier.

tcp packet arrivat at the application?

In the client-server environment, when client sends a packet (with source ip / dest ip / ports ... etc) requesting "GET /index.php ... etc",
at the server application (daemon) arrives the whole packet (the whole bits of data) including mac, IPs, ports, tcp flags, payload ? Or just the payload ?
Because I don;t understand how the scripts can read remote address (like echo $_SERVER['REMOTE_ADDR']; )
The server machine gets the whole packet. Its kernel and TCP/IP stack receives and processes it. The application server is using a socket to talk to the kernel, which is a higher-layer interface than raw packets; therefore it has a different view. Assuming we are talking about TCP, you will find among other things:
Information from the physical or datalink layer (such as source and destination MAC addresses) is not available on the socket (unless you do very fancy and probably non-portable things).
Some information from the IP & TCP layer is made available so the application can retrieve it using special system calls such as getsockname() and getpeername(). This includes the IP addresses and ports.
The application is not concerned with most of the rest of the information from the IP & TCP layers and it is not made available on the socket. For example, options, window size, checksum, fragment offset.
The application sends and receives data on the socket as though it was a continuous stream of bytes. It does not know or care how the datastream is broken up into small packets each containing a piece of the data.
for the specific case of $_SERVER['REMOTE_ADDR']; which you highlight, this information comes from the aforementioned getpeername() system call. PHP calls this for you and makes the information available.

Packet filtering in Windows (XP, 7 etc)

How can i filter (allow, deny etc) outgoing packets in Windows? I want to search in TCP or UDP packet types to find in the data segment for example this "387602304fd236e048125453b1fa10c980e9dad4fa7f3f5dd2497c2e8b2b" and drop/block/deny the packet, if it matches the search hex string.
I have already tried WIPFW and PKTFILTER but they only serve IP source, dest, port etc filtering. They don't inspect the packet's data.
I think Berkeley Packet Filter doe's that job, but it's for unix...
Here is some to filter packet in windows:
WinDivert Free open source project work on Windows 7, 2008 or upper. network layer.
WinpkFilter 3.0 Commercial, Windows XP and upper. datalink layer
pcausa, Commercial. datalink layer
Windows Filtering Platform Packet Modification Sample
A sample to create callout driver that WinDivert use, you should now to implement kernel driver. network layer.
you can use SmartSniff in windows.
Starting from version 1.10, you can filter unwanted TCP/IP activity during the capture process (Capture Filter), or when displaying the captured TCP/IP data (Display Filter)
You want application level filtering then, (just changing the payload). If you want to be able to drop, I know you can hook into Winsock, which will allow you to capture packets as they go out and set up a filter there. Windows seven also added to their firewall, so you could use that API to grab outbound packets; I'm not sure if it will allow you to specifically alter the payload data, though.

Resources