Sponsored Content
Full Discussion: best way to scan?
Top Forums UNIX for Dummies Questions & Answers best way to scan? Post 302710581 by DGPickett on Thursday 4th of October 2012 02:56:54 PM
Old 10-04-2012
There are 65536 udp and 65536 tcp ports on each IP address, and you can have sockets on all local sockets (listening 0.0.0.0) or just one, including just localhost (127.0.0.1). Usually, you just use all or localhost. This is IPV4; IPV6 goes wild in lots of ways besides longer (larger) numbers for IP, like anycast addresses.


The tool lsof from Perdue will tell you about all open files, including sockets that can be listening, connected or just open.
  • Connected is bound to a remote IP and port on the same IP Protocol (TCP or UDP).
  • Listening is more a TCP thing, but an open UDP port handler can spin off connected sockets.
  • An open UDP socket can take in UDP packets from all IPs and ports, and can send to the UDP protocol all IPs and ports. DNS is a great example -- sitting there reading packets from everyone, and for every packet read, sending out one packet, either an answer or a forwarded question. It has to keep trackof forwarded questions (recursion) so it can forward answers when they arrive. UDP does not include auto-retransmit, but DNS is an inquiry, so you can just ask again. The first query is not a waste, as it may have stored the answer more closely.
BTW, UDP can be used with broadcast IP on send to send one packet to all open ports of the specified number on all IP of that network. It can be used with MBone IPs to multicast, where lost packets can be recovered on intermediate hosts.
This User Gave Thanks to DGPickett For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

IP Name scan

Hi. how to search a range of IP:s for their registed IP names? Like nslookup or host for all IPs 130.xxx.xxx.1 to 130.xxx.xxx.254 //nicke (2 Replies)
Discussion started by: nicke30
2 Replies

2. UNIX for Advanced & Expert Users

Please let me know Regarding Port Scan

Can any one please let me know below ones 1) How to Perform the Port Scan in Solaris Environment and how to block the unwanted Ports. 2) How to know whether particular Port is listning the requests or not? Thanks Ramkumar.B (7 Replies)
Discussion started by: myramkumar
7 Replies

3. Shell Programming and Scripting

How to scan and capture

Hi, I am new to unix. I have a file with records like the below ads-sap-4.txt: </a></b></span><span class="linkbutton yellow_but"><a id="2005754_more" style="cursor:pointer; cursor:hand;"... (3 Replies)
Discussion started by: akondeti
3 Replies

4. Shell Programming and Scripting

scan direcotries

Hi I am new to this forum, and glad to be a part of it here after. I have an intersting issue for which I need suggestions of you great minds. I am in process a building a shell script which should scan a directory for a specified amount of time and prepare a list of all the files that were... (1 Reply)
Discussion started by: nagrcm
1 Replies

5. UNIX for Dummies Questions & Answers

scan and move

i have a script to look for a file, but it moves a file that's being used. i want to use: if file exists > 0, and not being updated/used in the last 2 minutes, move to /tmp i can do this much: if then mv filename.txt /tmp else exit fi or how can i check if... (3 Replies)
Discussion started by: tjmannonline
3 Replies

6. Shell Programming and Scripting

scan directory

The script should _scan a specific directory _If a file name is like one provided, then run the command to send the file via CFT The name should be picked from a list. The current list is : ... (11 Replies)
Discussion started by: fireit
11 Replies

7. AIX

Scan Rates

Dear Gurus, Can any one advice about the normal limits for the Page scanning rates on the AIX platforms, i am having enormous values for the scan rate along the hour it may reache 3000 pages/sec. Regards, Negm (2 Replies)
Discussion started by: Negm
2 Replies

8. Shell Programming and Scripting

scan compressed

Hello all I want to help I have some compressed files on the system When you want to unzip these files Delete any file which symlink "ln -s" {{ I need script is necessary Script contain: Any operation to decompress the system is doing to delete any symlink... (0 Replies)
Discussion started by: x-zer0
0 Replies

9. Red Hat

Scan For new LUNS

In Solaris the administrator has to update /kernel/drv/sd.conf file to tell the sd driver to scan for a broader range of scsi devices. Can someone please tell me what file needs to be update in Redhat Linux 5 for the same. Second part of the question is WWN for HBA's can be found (atleast in my... (1 Reply)
Discussion started by: Tirmazi
1 Replies

10. AIX

Scan Rate

Hello, How can i tell ifthe ratio between fr and sr is ok? is fr/sr ratio of 0.9 acceptable? thanks. (1 Reply)
Discussion started by: LiorAmitai
1 Replies
UDP(4)							   BSD Kernel Interfaces Manual 						    UDP(4)

NAME
udp -- Internet User Datagram Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> int socket(AF_INET, SOCK_DGRAM, 0); int socket(AF_INET6, SOCK_DGRAM, 0); DESCRIPTION
UDP is a simple, unreliable datagram protocol which is used to support the SOCK_DGRAM abstraction for the Internet protocol family. UDP sockets are connectionless, and are normally used with the sendto(2) and recvfrom(2) calls, though the connect(2) call may also be used to fix the destination for future packets (in which case the recv(2) or read(2) and send(2) or write(2) system calls may be used). UDP address formats are identical to those used by TCP. In particular UDP provides a port identifier in addition to the normal Internet address format. Note that the UDP port space is separate from the TCP port space (i.e. a UDP port may not be ``connected'' to a TCP port). In addition broadcast packets may be sent (assuming the underlying network supports this) by using a reserved ``broadcast address''; this address is network interface dependent. There are two UDP-level setsockopt(2)/getsockopt(2) options. UDP_OPTIONS may be used to change the default behavior of the socket. For example: setsockopt(s, IPPROTO_UDP, UDP_OPTIONS, NULL, 0); The UDP_ENCAP option can be used to encapsulate ESP packets in UDP. There are two valid enapsulation options: UDP_ENCAP_ESPINUDP_NON_IKE from draft-ietf-ipsec-nat-t-ike-00/01 and UDP_ENCAP_ESPINUDP from draft-ietf-ipsec-udp-encaps-06 defined in <netinet/udp.h>. The UDP_RFC6056ALGO can be used to randomize the port selection. Valid algorithms are described in rfc6056(7) and their respective constants are in <netinet/rfc6056.h>. For example, int algo = RFC6056_ALGO_RANDOM_PICK; /* see <netinet/rfc6056.h> */ setsockopt(s, IPPROTO_UDP, UDP_RFC6056ALGO, &algo, sizeof(algo)); The port selection can be also controlled at a global level for all UDP or UDP6 sockets using the following sysctl(7) variables: net.inet.udp.rfc6056.selected and net.inet6.udp6.rfc6056.selected respectively. Options at the IP transport level may be used with UDP; see ip(4) or ip6(4). DIAGNOSTICS
A socket operation may fail with one of the following errors returned: [EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destina- tion address specified and the socket is already connected; [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected; [ENOBUFS] when the system runs out of memory for an internal data structure; [EADDRINUSE] when an attempt is made to create a socket with a port which has already been allocated; [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists. SEE ALSO
getsockopt(2), recv(2), send(2), socket(2), inet(4), inet6(4), intro(4), ip(4), ip6(4), rfc6056(7), sysctl(7) User Datagram Protocol, RFC, 768, August 28, 1980. Requirements for Internet Hosts -- Communication Layers, RFC, 1122, October 1989. HISTORY
The udp protocol appeared in 4.2BSD. BSD
September 24, 2011 BSD
All times are GMT -4. The time now is 05:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy