How to send an IP packet in vxworks? - ip

I am developing a packet filter in vxworks platform.For that, I need to send an individual IP
packet. Can anyone say which is the simplest way for doing it? Can I use RAW socket in vxworks
as like linux?
Thanks & regards,
Likhin

Yes, you can use RAW sockets. Take a look at sockLib

Related

It is possible to create your own bit sequence and then send it to the network card of your choice?

For example, is it possible to send this "11110000 00001111" sequence alone, without any protocol encapsulating it, or even Ethernet or IP in order to implement a different protocol for my local network?
You can send the sequence without IP headers through an 802.3 frame. But I think MAC protocol already comes in the NIC with some logic also in the device driver.

How Can I get UDP messages coming on eth with openHAB?

I'm able to send UDP message to the remote IP node on eth with openHAB using the binding tcp/udp, i.e.:
udp=">[ON:10.44.212.60:3000:'MAP(mydevice.map)'],
[OFF:10.44.212.60:3000:'MAP(mydevice.map)']"
But I do not have idea what I have to do to get and store the response coming back.
Please who can help?
Thanks and regards
marco
Not possibile UTP is one-way communication, you will have to use TCP protocol.

Do I need an IP address?

I want to send data within a WLAN as fast as possible to another device within this WLAN? And I am completely confused at the moment.
If I want to send something from one device in this WLAN to another device in this WLAN. Do I necessarily need an IP Address then?
So I could write a program that produces IP Packets and sends them to the destination. Then I would program at Network layer.
Can I go to the data linklayer and send something to the Router in this WLAN and he figures out where to send it without any ip address? Would it be faster than programming at Network layer?
You could indeed sent to the MAC address. Bit I doubt if it's worth the effort. Using IP is the standard way of doing things. Speed would only improve minimally.
Yes, you need IP address in both devices if you are using TCP/IP stack.
You can directly send with the MAC address without IP if you are under the same lan switch. Use raw sockets. This is not recommended.

What is the best way to make TCP and UDP packet spoofing and injection?

Hy folks,
I'm kinda new to low level networking. I need to intercepts all TCP/UDP packets and potentially filter or substitute them with new ones.
What would be the best way to intercept these packets and inject new one? I'm only targeting Windows platforms.
You want WinPcap if you're on Windows. What you're going to need to do is intercept (and filter) packets with WinPcap and then write a program that does packet creation when/if you want it.
Write a program that uses libpcap at TCPDump contains tons of API for messing with low-level networking
I want to develop a program, not just use a tool
This page has some references to other pages which introduce the network device driver architectures: NDIS Intermediate driver interface.
You can use tools like wireshark to intercept traffic.
If you planning to write a program which will do all this stuff , then you may need to go to driver level to intercept all traffic.
wireshark uses libpcap . I am not sure but that may help

How can I discover if there are other devices on my local sub-net?

I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering "ping"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better?
You can try a broadcast ping (this is from linux):
ping -b 255.255.255.255
Another option is to download Nmap and do a ping-scan.
You could use nmap. It's still crude, but at least it's using a tool designed to do it so you don't have to spend time on it.
If you can't get reliable link state information from your Ethernet device (which most chipsets should support these days, BTW...), sending an ARP request for each IP on your local subnet is a decent substitute. The overhead is minimal, and as soon as you get a single response, you can be sure you're still connected to a network.
The only possible problem I see here, is that if your device is on a /8 subnet, it can take quite a while to loop through all 4294967296 possible IPs. So, you may want to consider some optimization, such as only sending ARP requests for your default gateway, as well as all IPs currently in your ARP table.
If there's a peer you know you were connected to recently you could try pinging or arping that first. That could cut down on the traffic you're generating.
you could also run tcpdump -n to see what's active on the network too.
Not receiving any responses to ICMP pings or ARP requests is not a 100% guarantee that there's no network connection. For instances, there might be devices on the network that are firewalled off.
EDIT: May be you could access some lower-level information on your embedded device to check whether the network interface has its link up without actually sending any data.
Is there any chance that your device supports UPnP or Bonjour? Beside of the low-level protocols your should also have a look at these protocols which support some kind of plug-&-Play functionality. A UPnP device for example sends a message on the LAN before it is switched off (though, this doesn't help if it is just removed by unplugging it...).

Resources