Programming :: Raw UDP Socket And ICMP Destination (Port) Unreachable?

Oct 26, 2009

I'm using a single raw socket to read UDP packets from local test network with 1024 ports. Each UDP src and dest port is unique and I need access to IP and UDP header fields. I can stream and process data (in and out) at 100 mbps in linux-rt kernel with very low jitter < 250 usec, 10 usec nominal.

I'd like to prevent kernel from issuing ICMP port unreachable errors back to the sending host, however, I don't want to create 1024 vanilla UDP sockets and bind to each one because of resource constraints. Currently, I'm using iptables to drop the outbound port unreachable messages. Does anyone know of a way (programmatic using C code) to prevent the ICMP unreachable traffic? Perhaps an IOCTL or socket option? I also tried changing /proc/sys/net/ipv4/icmp_ratelimit but that seemed to have no effect. By default the ratemask is set for dest unreachables and a variety of ratelimit values did not change any behavior that I could see.

View 5 Replies


ADVERTISEMENT

Programming :: Serial Port Becomes Unreachable After Being Opened And Closed Once?

Sep 22, 2009

I am writing a program to read and write to devices over my serial port. My program will need to connect to up to four other machines at once. I can connect to machines successfully, it works well. However, after I connect and disconnect once, attempting to connect again will cause the FIRST serial connection will fail and all the ones after it will pass.
e.g.

Code:
fd[0]=connect("/dev/ttyS0");
fd[1]=connect("/dev/ttyS1");
fd[2]=connect("/dev/ttyS2");
fd[3]=connect("/dev/ttyS3");
code....

That works as long as it is executed only once in the program. The second time it is executed, fd[0] will die and fd[1-3] will work normally.I can't figure out why this happens, but I found a workaround by connecting to "/dev/null" before any real serial ports.What should I do?

View 10 Replies View Related

Networking :: Relay Raw ICMP Packet To Local Destination

Feb 21, 2011

On my system, I have built my own tunneling protocol, where I relay packets over a non-standardized but verified medium. What I do is capture the packets using iptables and NFQUEUE, relay them over my medium, and at the other end I reinject them using raw sockets. The packet going into the tunnel is exactly the same as the one coming out, verified. The problem is that this doesn't work for ICMP Ping (Echo Request) if the destination of the ping is the same as the tunnel endpoint. If the destination is not the same as the tunnel endpoint, the ping packet is rerouted and arrives as it should at the receiver, and the ping reply comes back to the sender. Does anyone know whats going on? Isn't it possible to send raw icmp to yourself? If not, anyone have an idea what I should do instead?

View 1 Replies View Related

CentOS 5 Networking :: Dell1955 - Get Destination Host Unreachable?

Jul 30, 2010

I have 5 1955 blades in an enclosure for an custom application cluster.All were running Centos 4.4 no problem.We wanted to start upgrading them cleanly to 5.5 so two of them got fresh installs of 5.5.The installs went well enough, no glaring errors.However they can only ping each other! The network settings are fine, no firewall or selinux. I'd run the info script but I can neither download it to them nor paste it in via kvm.Standard static entries, virtually identical to their 4.4 brethren. They ping each other so network drivers are fine, no built in switch configuration changes. It has to be some kind of network configuration issue that i'm just not seeing.

Edit* When i try and ping anything else, including the other blades, I get Destination Host Unreachable.

View 5 Replies View Related

Fedora Networking :: OpenVPN Configuration - Destination Host Unreachable

Mar 6, 2010

I have a problem with the Fedora 12 Network Manager - OpenVPN configuration. If I use the same configuration and manually start openvpn (as client) I get connected to the OpenVPN server and I can ping the network that I am accessing. With Network Manager - I get connected but when I try to ping is giving me "Destination host unreachable". The routing table looks similar except that when connecting with network manager is giving me on more route in table

Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.xxx 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
192.168.171.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0

Where xxx.xxx.xxx.xxx is the IP of the OpenVPN server. When connecting "manually" I this routing table

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
192.168.171.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0

What I do wrong in Network Manager? If I try to delete the route with xxx.xxx.xxx.xxx is disconnecting the vpn connection.

View 8 Replies View Related

General :: Cannot Access/ping Debian \ Gives Destination Host Unreachable?

Nov 27, 2010

I cannot access/ping my Debian server. I know the IP is right (ifconfig, route and ip addr) all gave me 10.0.2.25 (route gave me 10.0.2.0).I cannot ping it from any computer in my netwerk, even when I try to ping it from my Debian itself, it gives me Destination Host Unreachable !(Wierdly, I can ping 10.0.2.2 tho).I am using virtualbox when the netwerk options 'NAT' turned on. When I look at my /etc/network/interfaces/ the last line looks like:iface eth0 inet dhcpShouldn't their be some other stuff listed?

View 6 Replies View Related

Fedora Networking :: Unable To See Other Wireless Machines - Destination Host Unreachable

Feb 17, 2009

I've got a problem with 'seeing' other machines on my Network. I have two laptops both with F10 on them however I can't ping either of them. They can connect fine to the internet and ping the router, they are both on the same subnet with Firewalls disabled on both machines. When I try to ping it says: "Destination Host Unreachable". I've tried firing up Wireshark to see if that will give me any clue but even that doesn't show any packets whatsoever from the other machine across the Network. It's like they are completely invisible to each other.

View 3 Replies View Related

Programming :: Socket Programming Using Php - Swap A Client Ip And Port?

Mar 28, 2011

Is it possible to swap a client ip and port ? This is what I am trying to do. Let say you have Comp1 and Comp2 And you have Server between them. My goal is to get Comp1 and Comp2 know each others IP So Comp1 connects to server And server stores comp1's IP In a text file or other place And Comp2 connect to server And server also stores his info And then both comp1 and comp2 dowload the tex file And use the info on it.

View 9 Replies View Related

Ubuntu Networking :: Internet Connection In 8.04 Server Edition - Destination Host Unreachable

Jun 8, 2010

i have a problem with my internet connection in ubuntu 8.04 server edition. if i ping to: [URL]... i get: Destination Host Unreachable but when i ping to my gateway or other pc's in my network no problems occur.

View 9 Replies View Related

Programming :: Tcp Client Socket : Get Own Port Number?

Oct 1, 2010

I am working with simple tcp client to establish connection to sockaddr_in servAddress and send data segment:

...
connect(sockfd,&servAddr,sizeof(servAddr)) < 0)
send(sockfd, pkt, pktLen, 0);
close(sockfd);
...

Elementary... Here's the tricky part: next i have to handle user level ack the server is sending to "client"... To do that i have to open server socket on the same port number the system assigned to my client socket before. How can i get it ( in user level code)?

View 2 Replies View Related

Networking :: Socket Programming - Connect To Port Y On IP X With Telnet

Sep 16, 2010

I have a customer who is complaining that they can connect to prt y on IP x with telnet. They are seeing the following:

telnet x.x.x.x y
Trying x.x.x.x...
Connected to x.x.x.x.
Escape character is '^]'.

after some time the connection of course times out. Connection closed by foreign host. There is no telnet service running on this port so they cannot do anything, but they are complaining tht the fact that telnet "connects" is a security risk. I am having difficulty explaining why they are able to connect with telnet. I know it has to do with the socket layer API in Linux but I am having difficulty explaining this sufficiently. I also can't just say "this is the way linux works" to them. I am looking through "UNIX Network Programming" by W.

View 3 Replies View Related

Programming :: Bind A PF_PACKET Socket To A Specific Port Number?

Sep 26, 2010

I am trying to create a socket to listen for a bootp response so I am using a PF_PACKET socket so that I get the response based on my mac. My problem is that I don't want to hear all traffic (as I do now) so would like to use a specific port number and bind to it.

View 1 Replies View Related

Programming :: Bind The Listening Socket To A Paricular Ip Address And Port?

Jun 26, 2011

I am learning network prgramming in linux in c,and try to build a server and in this server I want to bind the listening socket to a paricular Ip address and port.Bind function is showing error,I did not want to use wild card. Here is the code.

#include<stdio.h>
#include<sys/socket.h>
#include<strings.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<string.h>

[Code]...

View 2 Replies View Related

OpenSUSE :: Traceroute Broken In 11.4 - Unable To Create ICMP Send Socket: Permission Denied?

Apr 5, 2011

Code: # traceroute -I 69.12.32.2 Note: the -i and -I options were exchangedfor compability with LBL traceroute Use -I for ICMP, and -i <ifname> to specify the interface name unable to create ICMP send socket: Permission denied Note that the command was done as root. This worked in 11.3.

And yes, it works without the "-I". But it should work with the "-I". One shouldn't have to boot into Windows, just to run "tracert" there.

View 9 Replies View Related

Fedora Networking :: Connectivity Between Two Different Live IP Based Systems - Ping Error: "Destination Host Unreachable"

Aug 26, 2009

I have 2 live IP based Linux systems .

[Code]...

Both systems connected in same LAN based network . Both WAN live ips are connected through different modems. Problem is that , no system is able to ping or connect with other system with Live ip , though they are able to connect through LAN ip and both systes are accessable and also able to browse internet (google etc..) Ping error :-- Destination Host Unreachable.

View 2 Replies View Related

Programming :: Socket Programming - Detect Whether A Client Socket Is Closed / Active?

Mar 8, 2011

iam just trying to connect to server which accepts one client and server will read(blocking operation) infinitely, but After closing the client socket the server "read operation" is returning zero and "errno variable(in errno.h)" value is also zero. how can i detect whether a client socket is closed/active..?

client.c
Serv_Addr.sin_family = AF_INET;
Serv_Addr.sin_addr.s_addr = inet_addr("127.0.0.1");
Serv_Addr.sin_port = htons(26553);
if( 0 > connect (Serv_Fds,&Serv_Addr,sizeof(Serv_Addr)) )
{
perror("connect");
return 0;
[Code]....

View 3 Replies View Related

Networking :: MULTICAST Address And Port - Socket Listen Only On Port?

Feb 12, 2009

I make an application on GNU/Linux which listening on a MULTICAST stream, so I open my unconnected socket, bind it on a MULTICAST address and a port, join the multicast group with the "setsockopt (IP_ADD_MEMBERSHIP)", then I receive datagram on my socket.

Now I've two different instances of the same application that run with their own MULTICAST address and port. And what I found strange is that, after a misconfiguration, I switch the ports, for example:

Emitting on 225.0.0.1/23451 and 225.0.0.2/23452
Receiving on 225.0.0.1/23452 and 225.0.0.2/23451

And my receiving part doesn't care about the MULTICAST address, it looks like the socket is listening on the port number only! I mean that the receiver [225.0.0.1/23452] take its datagrams from emitter [225.0.0.2/23452] and vice-versa!

View 2 Replies View Related

General :: Socket Programming - Feed Some Words One By One To The Socket

Jul 6, 2010

i'm writing a simple program of client socket program. Here below is the code sample which i'm writing...

Code:
//tcp_client.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include<string.h>
#include<stdlib.h>
[Code].....

the above code works fine.if we copmile and run ./a.exe 192.xx.xx.xxx 1111 and press enter it works fine..everytime it asks "Please enter the message: " and if give that will be displayed in server. but my problem is i dont want to print everytime "Please enter the message: " i just want to feed some words one by one to the socket.

View 4 Replies View Related

Programming :: Setsockopt : Socket Operation On Non-socket Getting Error?

Mar 30, 2009

im getting that error in my code for some reason. I compiled my code, and when i try to run this server it throws me an error on my call to setsocketopt(). The only way it can reach that part of my loop is if it succeeds when it calls sock() so I dont understand why the error says its an operation on a non-socket. Im just trying to set up a server to pass messages from a client to it a viceversa. Here is the code:

Code:
int main()
{
int socket_fd, new_socket_fd, k;
struct addrinfo hints, *server_info, *p;
struct sockaddr_storage peer_address;
code....

View 7 Replies View Related

Ubuntu Networking :: Using Iptables To Change A Destination Port But Keep The Ip The Same?

Mar 23, 2010

I am playing around with transparent proxies, The current way I am doing things is the program makes a request to a computer on port 80, I use

Code:
iptables -t nat -A OUTPUT -p tcp --destination-port 80 -j REDIRECT --to-port 1234 to redirect to my proxy that I am playing with. the proxy will send out a request to port 81 (as all outbound port 80 are being fed back in to the proxy) so I want to do something like

Code:
iptables -t nat -A OUTPUT -p tcp --destination-port 81 -j DNAT --to-destination xxxx:80 The problem lies with the xxxx part. How do I change the destination port without changing changing the destination ip? Or am I doing this setup completely wrong,

View 2 Replies View Related

Ubuntu Security :: UFW Block ICMP When Add Non ICMP Related Rule

May 21, 2011

I am setting up a virtual server. Ubuntu 11.04, "minimal provider image".UFW was disabled by default. I set it to default deny. Allowed HTTP, SSH and other standard stuff, and enabled it. All seems to be OK. Adding one rule to block some annoying security scanners causes ping not to work. I'm not an Iptables expert, but it looks OK to me. I got it from some website, rather than invented it myself, but modified to to fit the ufw config file syntax. What in that rule prevents pings?!? It seems completely unrelated.

View 1 Replies View Related

Security :: Firewall Deny Traffic Inbound Destination Port 53372 & 53375?

May 5, 2010

I have a question, on my firewall at work I am seeing a constant flow of denies from many different source IP addresses, of tcp/udp destination port 53372 & 53375.What in the world is that, and why these two ports over and over

View 1 Replies View Related

Networking :: TCP And UDP Socket On Same Port ?

Nov 20, 2009

Can we open TCP and UDP socket on same port number?

View 1 Replies View Related

Networking :: Raw SCTP Socket Cannot Bind With Port?

Jul 26, 2010

If I open a raw SCTP socket, am I able to bind to a specific port? (I only want to see SCTP packets from a particular IP address AND port.) Or, any raw SCTP socket, regardless of port binding , will get all SCTP packets received by the OS from that IP address? The port doesn't matter and is ignored.

View 1 Replies View Related

Programming :: Make A Listener For ICMP Packets?

Oct 17, 2010

I have a gateway server which is currently listening for TCP/UDP packets and authenticating clients if their details IP/MAC is known.

I have a couple of clients who's network equipment sends ICMP pings to a remote site to determine internet connectivity and I'm missing those resulting in the client's device not logging in.

Is there some way that I can write a listener similar to a listener for TCP/UDP sockets which will listen to ICMP packets and pick up the IP and MAC address of the sender upon which I can perform processing on?

View 1 Replies View Related

Programming :: ICMP Packet Recieving Using Hook Function

Oct 7, 2010

I want to receive an icmp packet using net filter hook function. A string will be printed if an icmp packet is received.I am able to print the string. but the packet loss in the log message shows 100%packet loss.So i changer hooknum = NF_IP_FORWARD.but still its not working.I want to get log message as received 100%

View 1 Replies View Related

Ubuntu :: Failed To Create UDP Socket (SIP) On Port 5060 Address

Mar 13, 2010

I can't seem to get on my Twinkle SIP Phone, it says: "Failed to create a UDP Socket (SIP) on port 5060 Address already in use" after that message it brings me back to the window were I'm supposed to run my profile, how do I fix this?

View 6 Replies View Related

Debian Configuration :: Cannot Open Java Socket - Port (9955) Closed

Feb 26, 2010

I have a java application that I wrote recently. It runs off port 9955. The application runs great on my mac server. When I installed it on my linux box i cant get to it from outside the box. A port scan shows the port as closed. I flushed my iptables, did not help. I can telnet into the app locally, from the server and it works great. I cannot telnet from outside the server. I have a reference to the application in /etc/services as a tcp port (which it is).

netstat shows it as listening
netstat --listen
tcp6 0 0 [::]: SimpleSocketTest [::]:* LISTEN
netstat -anp | grep 9955
tcp6 0 0 ::: 9955 :::* LISTEN 1484/java

View 4 Replies View Related

Networking :: Fedora 11 Gnome Application Can't Connect To Socket Port 8005

Jul 3, 2009

I have an x application I am trying to run under gnome. It assumes a fixed ip address and exclusive use of the eth0. I have run it under gnome on RHEL 5.3. I set the ip address and ifconfig confirms the correct address. When I run it I get "SocketConnect() error:

Resource temporarily unavailabele, port 8005. (on the terminal that I started it)

This is indicative that it has failed to make a connection to the outside world. One difference I notice between the non-working and the working is that, the error message seems to stop coming out on the fedora gnome, almost immediately, whereas on the other installations it will come out indefinitely until it connects. is virb0 interferring. What is different in the networking on fedora 11 then RHEL?

View 2 Replies View Related

Networking :: Using A Perl Script To Test For A Socket Listening On A UDP Port On A Remote Host?

Mar 10, 2011

is it possible using a perl script to test for a socket listening on a UDP port on a remote host ?I work in an environment where netcat is not allowed and from time to time I need to see if a UDP port is open on a remote host.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved