Selecting interface based on source and destination ip address


 
Thread Tools Search this Thread
Special Forums IP Networking Selecting interface based on source and destination ip address
# 1  
Old 07-30-2009
Bug Selecting interface based on source and destination ip address

Hi all,

I have some doubts in selecting the interface to transfer packets and receive the packets.

--> Multiple interfaces :
--------------------

1) 0.0.0.0 --------> wild card address.
2) x.x.x.x --------> valid address.(192.168.1.156)
3) ff.ff.ff.ff --------> broad cast address.


1) If an socket is binded to 0.0.0.0 and its destination ip address is ff.ff.ff.ff

In order to transfer a packet, the packet should be transferred through all interfaces.(broadcasetd).

2) If an socket is binded to 0.0.0.0 and its destination ip address is x.x.x.x

Based on destination ip address an inetrface will be selected to transfer the packet.

Before receiving the packets, the selected interface is closed.
Now the received packets consists of destination ip address as closed interfaces ip address. Whether the received packets are valid or not.


Thanks in advance.........
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Open ports from source to destination

Is there a way to find out all the ports open between source IP & destination IP in any way ? (12 Replies)
Discussion started by: UnknownGuy
12 Replies

2. UNIX for Advanced & Expert Users

C program to detect duplicate ip address if any after assigning ip address to ethernet interface

Hi , Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies

3. Shell Programming and Scripting

Count the number of files copied from source to destination location

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files from... (23 Replies)
Discussion started by: sravanreddy
23 Replies

4. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh usa0300uz1247.apps.mc.xerox.com... (0 Replies)
Discussion started by: lovelysethii
0 Replies

5. Linux

rpmbuild, how to specify a different source and destination path for files

I'd like to specify a different build and deployment path for files, by default the same path is used for both build and install, I wasn't able to find a way to make these different. With Solaris pkgadd, one can specify different paths in prototype, so I would assume something like that is possible... (0 Replies)
Discussion started by: tiburblium
0 Replies

6. Shell Programming and Scripting

Move all files from source to destination directory based on the filename

Move all files starting with a specific name to different directory. This shell script program should have three parameters File Name Source Directory Destination Directory User should be able to enter ‘AB_CD*' in file name parameter. In this case all the files starting with AB_CD will... (1 Reply)
Discussion started by: chetancrsp18
1 Replies

7. SCO

Change SCO - GUI or Desktop interface to DOS based interface

Hi all I have installed a demo version of SCO OpenServer 5.0.2, I finally found it is Desktop Interface, I would like to know how to change its interface to dos based interface? If you have any ideas, please tell me then. Thank you (2 Replies)
Discussion started by: TinhNhi
2 Replies

8. IP Networking

Selecting Interface based on Destination IP address

Hi all, How an interface is selected based on the destination ip address. Thanks in advance........ (5 Replies)
Discussion started by: vijaypdp2006
5 Replies

9. Shell Programming and Scripting

Count total unique destination for source

Hi, need help how to count unique destination for the source ip. The file is contains 4 number of fields. Example of the file is here src ip dest ip #of flows total bytes 192.168.6.0 88.0.33.2 12 128 192.168.6.0 88.0.33.2 1 168 192.168.6.0 ... (5 Replies)
Discussion started by: new_buddy
5 Replies

10. UNIX for Advanced & Expert Users

Byte Rate to/from a source/destination

is there a command in unix/linux that allows you to sample what the historic byte rate is from a local IP to a client IP. (1 Reply)
Discussion started by: cubs0729
1 Replies
Login or Register to Ask a Question
ip(4p)																	    ip(4p)

Name
       ip - Internet Protocol

Syntax
       #include <sys/socket.h>
       #include <netinet/in.h>

       s = socket(AF_INET, SOCK_RAW, 0);

Description
       The  IP	is the transport layer protocol used by the Internet protocol family.  It can be accessed through a ``raw socket'' when developing
       new protocols or special purpose applications.  IP sockets are connectionless and are normally used with the and calls.	The call, however,
       can also be used to fix the destination for future packets, in which case the or and or system calls can be used.

       Outgoing  packets automatically have an IP header prepended to them, based on the destination address and the protocol number the socket is
       created with.  Incoming packets are received with their IP headers and options intact.

Diagnostics
       On failure, a socket operation returns any of the following errors:

       [EISCONN]      Tried to establish a connection on a socket that already had one, or tried to send a datagram with the  destination  address
		      specified when the socket was already connected.

       [ENOTCONN]     Tried to send a datagram, but no destination address was specified and the socket was not connected.

       [ENOBUFS]      The system ran out of memory for an internal data structure.

       [EADDRNOTAVAIL]
		      Made an attempt to create a socket with a network address for which no network interface existed.

See Also
       send(2), recv(2), inet(4f), intro(4n), packetfilter(4)

																	    ip(4p)