LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2006, 09:14 AM   #1
vasanthbp
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
tcp connection and interface status


Hi,
I need your help, plz respond.

Suppose a machine has 2 interfaces eth0, eth1. And suppose we are running
a tcp application on that(bounded to eth0). Now, if I turn off the
interface eth0, I cann't see anymore packets being generated from
Transport or Network layer. The application stalls till the interface
eth0 comes up again.

But I was expecting packets to be generated and routed through interface
eth1.

Can you guide me as to where exactly is the problem ? How does interface
status gets notified to the tcp socket?

I tried going through kernel codes(tcp.c tcp_output.c tcp_ipv4.c ip_output.c)
but things are not clear to me. Initially I thought that proble might be
with sk->dst_cache, but now I am little suspicious.


Plz somebody respond
 
Old 06-28-2006, 09:58 AM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
If you want an active backup you can use bonding which is really cool!

Bonding is offering several states like

- Active Backup
- Round Robin
- xor
- Broadcast
- iee802.3ad
- load balancing
- adaptiv load balancing

So, should the second eth be a backup interface?

Don`t connect 2 eth with the same network an the same subnet configuration. I also did not belive that this type of configuration is going to cause problems in the past. But it really is (depending on the services you are going to start in the future!)

Last edited by saavik; 06-28-2006 at 10:00 AM.
 
Old 06-28-2006, 10:09 AM   #3
gizza23
Member
 
Registered: Jun 2005
Location: Chicago, IL, USA
Distribution: Fedora Core, CentOS
Posts: 188

Rep: Reputation: 31
I'm trying to sort through the information here and it's quite difficult to be honest. I dont know how you are monitoring the conversion of transport layer's session data units and the network layer's packet data units but I'm sure you are doing it. As for the operation of the NIC cards, or network interface cards (eth0 and eth1), you are treating the as if they automatically failover to one another should one fail. This type of setup is usualy pursued for redundancy in servers so it's not impossible but it will not work without some type of software to setup the "failover" that you want to see.

As for the TCP sockets, if they are open and listening then they are open and listening. The sockets are operate on the transport layer while the NICs operate on the physical. If there is a transmission destined for eth0 but it is down then the packets will be dropped because there is no recipient to take the data on a hardware level or even a software level because the packets assigned to the IP address of that NIC card will be unavailable as well. So a new session will have to be started to take up the slack using eth1.

So you want to search for failover software for your NICs. I hope this answers your question.

Good luck!

Last edited by gizza23; 06-28-2006 at 10:24 AM.
 
Old 06-28-2006, 10:15 AM   #4
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
bonding is building a virtual dev like bond0 beside eth0 eth1 and so on.

so with bonding your ip would be still up is one or more eth`s are going down or are disconneted from the network eg. switch is offline.
 
Old 06-30-2006, 06:46 AM   #5
vasanthbp
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanx for your valuable suggestions.

I have some clarifications regarding Linux bonding box

1. Can multiple network interfaces be assigned different IP addresses. So, that the master interface(bond0) takes the different IP addresses depending on the slave interface being used at any instant.

2. Does linux bonding box supports wireless interfaces as slave.
 
Old 06-30-2006, 07:04 AM   #6
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
1.) NO
2.) Think yes but didn`t check it
 
Old 06-30-2006, 09:23 AM   #7
vasanthbp
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
thank you very much.

Let me explain what I am trying to do.

I am assuming that I have 2(or more)network intefaces with each interfaces configured with different IP addresses(each interface has a different gateway). Each interfaces and the corresponding routes declared have priority in the kernel routing table(using "metric" field).

Now I would like to declare a virtual network inteface(say bond0, which IP address), such that this will have the highest priority in the routing table. All application would bind to virtual network interface. The virtual network interface in turn will make use of a specific physical interface(eth0) to transfer the packet(frame should contain eth0's mac address). But when the physical interface being used goes down, the VNI should switch over to the other physical interface available(eth1, with frame containing eth1's mac address).

Is there any device driver or software which can help me to do the above task.
 
Old 07-04-2006, 02:38 AM   #8
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
I do not have any idea, how to do that, but I would suggest you to user bonding, cause its working optimal.

Maybe you can add 4 interfaces an bond two of each together!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Interface Status ejtbrown Programming 5 08-04-2006 01:12 AM
Get the current TCP/UDP conenction status amit.saha Linux - Networking 3 06-23-2006 01:57 AM
Ethernet interface - checking the status marri Programming 1 03-01-2005 12:15 PM
network connection status ................ dileepkk Linux - Networking 1 07-09-2004 12:38 PM
multiplayer tcp/ip game & loopback interface on RH 8 kkempter Linux - Networking 2 02-04-2003 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration