|
||||||||
|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|
My laptop has two networkcards (ethernet, wlan). I connect via wlan, open loads of ssh-session and xterms on other machines and finally come back to my desk and want to connect via ethernet. So I plug in ethernet and perform ifconfig wlan0 down dhclient eth0 within one second I'm connected to the internet via ethernet, but all my connections are lost. What is the trick to keep the sessions alive? * screen - somehow I never got used to it * same ip - give the same mac to wlan and ethernet to get the same ip on both cards and hope this will keep the sessions open. This somehow doesnt sound smart to me. To networkcards with the same MAC on the same machine sure pegs for troubles ![]() thnx, peter peter pilsl |
|
#2
|
|||
|
|||
|
peter pilsl wrote:
> > My laptop has two networkcards (ethernet, wlan). I connect via wlan, > open loads of ssh-session and xterms on other machines and finally > come back to my desk and want to connect via ethernet. So I plug in > ethernet and perform > > ifconfig wlan0 down > dhclient eth0 > > within one second I'm connected to the internet via ethernet, but all > my connections are lost. > > What is the trick to keep the sessions alive? > > * screen - somehow I never got used to it Well, get use to it. > * same ip - give the same mac to wlan and ethernet to get the same ip > on both cards and hope this will keep the sessions open. This somehow > doesnt sound smart to me. To networkcards with the same MAC on the > same machine sure pegs for troubles ![]() > It won't work. First of all I'm afraid your TCP connections will be terminated on "ifconfig down" so there won't be anything to resume. Second, a TCP/IP session is not all about MAC/IP addresses, it's about data structures in the kernel (like packet sequence number, transmission buffers, etc). Forget it, it's not possible. Mihai > thnx, > peter |
|
#3
|
|||
|
|||
|
Mihai Osian wrote:
> > Well, get use to it. > NAG last time I tried I ended up with myriads of neverterminatingscreensessions on myriads of servers ![]() yep - I know I'm childish and I dont even have access to that many servers and I know that myriads of other users use screen but I would prefer a more transparent solution. >> > It won't work. First of all I'm afraid your TCP connections will be > terminated on "ifconfig down" so there won't be anything to resume. > Second, a TCP/IP session is not all about MAC/IP addresses, it's about > data structures in the kernel (like packet sequence number, transmission > buffers, etc). Forget it, it's not possible. > I'm sure there is an easy trick. Even now my laptop can roam between difference accesspoints and does not loose connection. And I can reset my mainrouter and still dont loose the connections. I'm thinking about a virtual networkinterface that is used to initiate the tcp-ip connection and keep tracks off all the tcp/ip-parameters. The ethernet and wlan-card then is only another hop to the targetserver. Does this sound realistic or just shows that I dont have too much clue about the insides of networking. thnx, peter |
|
#4
|
|||
|
|||
|
On Thu, 14 Jul 2005 14:09:37 +0200, peter pilsl <(E-Mail Removed)>
wrote: >> I know I'm childish and I dont even have access to that many >servers and I know that myriads of other users use screen but I would >prefer a more transparent solution. > At the network level: A tcp connection is defined by four parameters: local ip address, local port, remote ip address and remote port. Your wlan and ethernet interfaces are required to have different ip addresses. One ip address cannot be split between two interfaces. So when you switch from one adaptor to the other, you get a new ip address, and your old tcp connections cannot be maintained. At the applications level: Your ssh and xterm sessions depend on tcp connectivity. When that connection is lost, they die. The way to fix it is to re-write ssh and xterm so that they maintain a session when a tcp connection is re-established. But I don't think you really want to do that. ;-) >I'm sure there is an easy trick. Even now my laptop can roam between >difference accesspoints and does not loose connection. That's because the four parameters that define a tcp connection haven't changed. You might have changed the physical location where the data comes from, but the logical connection remains. > And I can reset >my mainrouter and still dont loose the connections. The tcp connection is maintained logically at either end. That is to say, both ends are using the same four tcp parameters to define the connection The ability to transfer data might be temporarily halted, but the end points don't necessarily know that. When data transfer resumes, the endpoints carry on where they left off. >I'm thinking about a virtual networkinterface that is used to initiate >the tcp-ip connection and keep tracks off all the tcp/ip-parameters. The >ethernet and wlan-card then is only another hop to the targetserver. >Does this sound realistic or just shows that I dont have too much clue >about the insides of networking. It's an interesting idea. Have a third, virtual interface with it's own ip address, so the address never changes. Route the packets through the interface that's up. Your network router would have to also know about the alternate route. Doesn't sound easy to implement, though. Dan |
|
#5
|
|||
|
|||
|
Mihai Osian wrote:
> peter pilsl wrote: > >> >> My laptop has two networkcards (ethernet, wlan). I connect via wlan, >> open loads of ssh-session and xterms on other machines and finally >> come back to my desk and want to connect via ethernet. So I plug in >> ethernet and perform >> >> ifconfig wlan0 down >> dhclient eth0 >> >> within one second I'm connected to the internet via ethernet, but all >> my connections are lost. >> >> What is the trick to keep the sessions alive? >> >> * screen - somehow I never got used to it > > > Well, get use to it. > >> * same ip - give the same mac to wlan and ethernet to get the same ip >> on both cards and hope this will keep the sessions open. This somehow >> doesnt sound smart to me. To networkcards with the same MAC on the >> same machine sure pegs for troubles ![]() >> > It won't work. First of all I'm afraid your TCP connections will be > terminated on "ifconfig down" so there won't be anything to resume. > Second, a TCP/IP session is not all about MAC/IP addresses, it's about > data structures in the kernel (like packet sequence number, transmission > buffers, etc). Forget it, it's not possible. > > Mihai > >> thnx, >> peter > > To correct myself: TCP connections are _not_ terminated by ifconfig down. So I'm going to shut up now ![]() Mihai |
|
#6
|
|||
|
|||
|
Mihai Osian wrote:
>> * same ip - give the same mac to wlan and ethernet to get the same ip >> on both cards and hope this will keep the sessions open. This somehow >> doesnt sound smart to me. To networkcards with the same MAC on the >> same machine sure pegs for troubles ![]() >> > It won't work. First of all I'm afraid your TCP connections will be > terminated on "ifconfig down" so there won't be anything to resume. > Second, a TCP/IP session is not all about MAC/IP addresses, it's about > data structures in the kernel (like packet sequence number, transmission > buffers, etc). Forget it, it's not possible. Actually, it is, if he uses a VPN. I was doing some experimenting a few weeks ago. I was able to switch among a few different WLANs, some on different providers, without losing my VPN. The VPN uses UDP, so it doesn't care what connection is up at the time and anything going via the VPN doesn't know about network changes (provided you make the change quick enough). |
|
#7
|
|||
|
|||
|
peter pilsl wrote:
> I'm sure there is an easy trick. Even now my laptop can roam between > difference accesspoints and does not loose connection. And I can reset > my mainrouter and still dont loose the connections. That's not quite the same thing, as you're not changing interfaces. Changing access points is more like using different ports on a switch. |
|
#8
|
|||
|
|||
|
Dan wrote:
> It's an interesting idea. Have a third, virtual interface with it's > own ip address, so the address never changes. Route the packets > through the interface that's up. Your network router would have to > also know about the alternate route. Doesn't sound easy to implement, > though. > A VPN perhaps? |
|
#9
|
|||
|
|||
|
"Mihai Osian" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) ... > It won't work. First of all I'm afraid your TCP connections will be > terminated on "ifconfig down" so there won't be anything to resume. > Second, a TCP/IP session is not all about MAC/IP addresses, it's about > data structures in the kernel (like packet sequence number, transmission > buffers, etc). Forget it, it's not possible. If the TCP connections terminate on "ifconfig down", that should be considered a bug. The loss of an interface should not break TCP connections, otherwise there'd be little point in having more than one interface. The (possibly temporary) inability to reach a destination should not break TCP connections either. DS |
|
#10
|
|||
|
|||
|
"Dan" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)... > A tcp connection is defined by four parameters: local ip address, > local port, remote ip address and remote port. > Your wlan and ethernet interfaces are required to have different ip > addresses. One ip address cannot be split between two interfaces. > So when you switch from one adaptor to the other, you get a new ip > address, and your old tcp connections cannot be maintained. That's total nonsense. One IP address can certainly be reachable through multiple interfaces. One can even rig it so that, for example, the IP address normally reachable through the wlan interface is routed to the ethernet interface if the wlan interface is not up. DS |
![]() |
| Tags |
| breaking, networkconnection, sessions, switch |
| Thread Tools | |
| Display Modes | |
|
|