Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Ethernet switch question - moving between ports  (Read 308 times)

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Ethernet switch question - moving between ports
« on: January 18, 2017, 11:15:05 AM »

[I somehow get the feeling that this is a really, really stupid question.]

Say you have a device plugged into a smart LAN switch on port x. The switch has learned to forward unicast frames to port x, it is not merely flooding out of ignorance.

What happens when I move the device to port y? Does the switch sense the physical disconnection? If so, does it go back to flooding?

Now, what happens if the device ‘moves’ to port y because it was connected to a WAP attached to port x and then roams to another WAP attached to port y? Can't use the physical reattachment argument now to get out of this. So does that mean that the gaining WAP has to send some MAC frame with the roaming device's MAC in it as source address so that the switch will work? What about frames in flight heading for the old (losing) WAP? I don't know whether or not the losing WAP knows where the roaming device is roaming to, but if it does, there are various showstopping problems with most of the ways I have thought of for dealing with this problem.
Logged

d2d4j

  • Reg Member
  • ***
  • Posts: 386
Re: Ethernet switch question - moving between ports
« Reply #1 on: January 18, 2017, 01:08:26 PM »

Hi weaver

I think your overthinking this sorry

Moving a connection from port x to port y on a smart switch, the switch table already knows the MAC of the device, and say your device been sent to does not change port, then it also knows this, so directs accordingly

I'm not sure I understand you data in flight, but if any data is in transmission when you unplug the losing device your removing, this data would be lost, due to no route, but it minuscule as your only talking of the data last sent by the losing device been removed. Simply turn the device off before unplugging from smart switch

On roaming, this is for waps and not your smart switch to do, and should follow as above on port switch detail

As I said, I think your overthinking this sorry, but apologies if I am wrong in any way/description

Many thanks

John
Logged

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Re: Ethernet switch question - moving between ports
« Reply #2 on: January 18, 2017, 01:50:34 PM »

> the switch table already knows the MAC of the device, and say your device been sent to does not change port, then it also knows this, so directs accordingly

i'm sorry john, i didn't follow you there?
Logged

huwwatkins

  • Member
  • **
  • Posts: 71
Re: Ethernet switch question - moving between ports
« Reply #3 on: January 18, 2017, 02:03:03 PM »

In your first example where the device is removed and re-added to a different port then it will use flooding to re-find the mac address of the device so that it can update its mac address table and carry on forwarding traffic to it.

Here is a more detailed answer:
http://networkengineering.stackexchange.com/questions/13012/how-does-a-switch-learn-a-switch-table

Quote
Layer 2 switches (bridges) have a MAC address table that contains a MAC address and port number. Switches follow this simple algorithm for forwarding packets:

When a frame is received, the switch compares the SOURCE MAC address to the MAC address table. If the SOURCE is unknown, the switch adds it to the table along with the port number the packet was received on. In this way, the switch learns the MAC address and port of every transmitting device.
The switch then compares the DESTINATION MAC address with the table. If there is an entry, the switch forwards the frame out the associated port. If there is no entry, the switch sends the packet out all its ports, except the port that the frame was received on (Flooding).
Note that the switch does not learn the destination MAC until it receives a frame from that device.

In the second example i'd imagine that its done at Layer 3 and not 2 (which is what a smart switch would be).
Logged

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Re: Ethernet switch question - moving between ports
« Reply #4 on: January 18, 2017, 03:18:59 PM »

So for the physical move case, do you think it relies on detecting physical disconnection to know go back to flooding?

For the WAP roaming case, stations don't have to use any particular L3 protocol that is recognised by your particular switch. A switch that fails in the case where any ethernet frame's payload might be other than IPv4 say would not be good.
Logged

aesmith

  • Reg Member
  • ***
  • Posts: 619
Re: Ethernet switch question - moving between ports
« Reply #5 on: January 18, 2017, 06:46:02 PM »

So for the physical move case, do you think it relies on detecting physical disconnection to know go back to flooding?
That's a good question.  You're envisaging a scenario where the device, formerly reachable via port A, but now no longer reachable via that port, but reachable via say Port B.   I would be pretty sure that any half decent switch would delete the mac from it's table if port A went physically down, but otherwise the entry is going to live on until it times out, or until the device transmits something (which will re-write it's entry to match the new port).

This came up at a session I was at discussing some gear, and that particular equipment uses unsolicited packets of some sort to trigger re-learning in the event of a failover - however I can't remember what the exact mechanism was.  However in that case it was pretty much what you said first "So does that mean that the gaining WAP has to send some MAC frame with the roaming device's MAC in it as source address so that the switch will work?"   I don't know the details but there are definitely some fancy wireless roaming algorithms implemented.

I would say that other than special provisions like that, in general devices do not go long enough without transmitting something for this to be a problem.  Not many devices or protocols listen without talking (glaring exception there is Microsoft network load balancing where in some configurations the virtual MAC is never used as a source, meaning that traffic floods everywhere unless you strictly contain it)
Logged

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Re: Ethernet switch question - moving between ports
« Reply #6 on: January 19, 2017, 01:57:49 AM »

If I were designing a WAP and implementing the handling of roaming, then I would try and find some kind of harmless frame that a gaining WAP could immediately send out whose source MAC address is that of the new station, purely to let the switch sniff it.

If APs don't handle this properly at all, maybe operating systems (or much less likely, device drivers) kludge the issue by sending any old frame out on roaming. For all I know, it's well known amongst operating system designers that WAPs don't necessarily do the required thing. Imagine that an example of this might be a packet to a DHCP server (but who is to say you are even using DHCP at all) just to tickle the switch, or alternatively some useful packet to some destination to try and detect whether you are even on the same subnet. If the first case is a reality, I wonder if that's why RevK is seeing failures of DHCP address management (well, you get stuck with an IPv4 link-local address anyway) when Apple devices roam and all goes pear-shaped on Ubiquiti kit.
Logged

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Re: Ethernet switch question - moving between ports
« Reply #7 on: January 19, 2017, 02:13:18 AM »

Actually, another case is that of a switch A connected to two other switches B and C. The device is simply physically moved from switch B to switch C.
Logged

aesmith

  • Reg Member
  • ***
  • Posts: 619
Re: Ethernet switch question - moving between ports
« Reply #8 on: January 19, 2017, 07:40:32 AM »

In that scenario switch A will remember the host mac as being via the link to B, and will retain that until it either ages out, or until the host transmits something at which point the tables in all three switches will be updated.   I think it's pretty safe to assume a physical move like that will result in a break in communications, and I can't think of many (any?) occasions when the reconnected host will sit silent and listening only.

If the path between two switches changes, it will depend on the mechanism behind that change.  For example spanning tree will flush tables on a topology change.

I think it's only wireless where there's a necessity for L2 roaming with minimal or no downtime.  The basic mechanism is at the end of this chapter here ..
http://www.ciscopress.com/articles/article.asp?p=102282&seqNum=2
Logged

Weaver

  • Kitizen
  • ****
  • Posts: 3775
  • Retd sw dev; A&A; 3 × 7km ADSL2; IPv6; Firebrick
Re: Ethernet switch question - moving between ports
« Reply #9 on: January 19, 2017, 07:54:26 AM »

Basically it sounds to me then as if an o/s is mad if it doesn't transmit a frame of some sort when it regains physical communication i.e. when an interface comes back up or a link into an interface gets remade after a break. When I write an o/s I'll remember this. (I've never written anything involving this kind of networking before, but I did have to worry about topology changes on other kinds of network when I was writing some relevant stuff a couple of decades ago.)
Logged
 

anything