LinuxQuestions.org
Help answer threads with 0 replies.
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 08-17-2007, 03:27 AM   #1
anil_mnnit06
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
working of a switch


i m having doubts regarding workin of a switch........

suppose there are four ports p1,p2,p3,p4........
each oh which is connected to node A,B,C,D respectively.....

intially the swicthing table maintain by the switch will have no entry,
so when packets come for A ,it will be send to each of the nodes.
but as it keeps on recieving packets and after delievring...it make the entry that on which port which node is connected by storing it MAC addresses.....
nxt time when packets come for A, it will be send directly to A...
switching table is mainatin for a particaulr time period also..
i hop upto this much i m correct.......if any where i hav gone then
plzz tell...i m a beginner..


now suppose within this time period i interchange the node A and B
i.e port p1 is conneccted to B, and port p2 is connected to A

now if packets comes for A ....
then who will be recieving the packets A or B ......???
 
Old 08-17-2007, 03:41 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 200Reputation: 200Reputation: 200
I should imagine as it's netwok infrastructure it is
sending to the MAC address of it's clients, it don't care
what physical port it is on
 
Old 08-17-2007, 10:50 AM   #3
anil_mnnit06
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
what do you mean by network infrastructure..........could you plzz elaborte little more.......
i was not able to get your point...
has it any thing to do with IP address..........?????
 
Old 08-17-2007, 10:59 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 200Reputation: 200Reputation: 200
i'm sure there's something here ...
http://en.wikipedia.org/wiki/Network...ss_translation
http://en.wikipedia.org/wiki/Network_switch

no it doesn't care about IP addresses (AFAIK)
it just routes packets on their MAC address, i.e. their unique hardware
address. All equipment,(e.g. a network card) has a unique address.
this is like the IP address within the local network.
 
Old 08-19-2007, 11:38 AM   #5
joemadeus
LQ Newbie
 
Registered: Aug 2007
Distribution: Debian Lenny AMD64 (2.6.28.5 kernel)
Posts: 10

Rep: Reputation: 0
Actually, neither of those wikipedia pages mention infrastructure. I'm curious to hear the answer of the original poster's question, too, since I'm trying to get a Debian box running with two Ethernet devices and a wireless card on the lan side, plus another Ethernet device for the wan side (connected to a cable modem.) I want the box to behave like a switch. I have iptables up and running with port forwarding, but the arp tables seem to get screwed up with more than one device attached (they're all using static IPs on 198.168.0.0/24)

I was told that I need to set up the lan-side devices as infrastructure ports (or switch ports) but using the word "switch" in just about any search engine you come across (including the one here) doesn't give me what I need.

Would you mind updating the wikipedia entries, or adding some info here so I can do it? (with your permission, of course.)

Thanks!


-j
 
Old 08-22-2007, 09:48 AM   #6
joemadeus
LQ Newbie
 
Registered: Aug 2007
Distribution: Debian Lenny AMD64 (2.6.28.5 kernel)
Posts: 10

Rep: Reputation: 0
Bump -- Any info on creating (if I need to) switch ports using a debian distro? Thanks.


-j
 
Old 08-22-2007, 12:49 PM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
A switch creates an mac-address-table that lists all the connected devices and what ports they are on by passively listening to the traffic it is passing.

If the switch does not find the mac address it is looking for (in your example the hosts were moved to different ports) teh switch or NIC on the sending PC can do an arp-broadcast and ASK who owns mac address xxxxxx. the NIC owning that address will reply and the mac-address-table will be updated. the switch can then forward the packet to the appropriate device.

It's also possible with spanning-tree enabled on the switch that when you swap the hosts those ports will begin the spanning-tree process and learn the mac-addresses of the connected hosts at that time and the table will be updated before the switch allows those ports to start forwarding traffic again. Cisco: How spanning tree works

sometimes the arp cache will not update soon enough (common on Cisco Routers) and connectivity issues will be a problem until you forcefully clear the arp-cache / mac-addresss-table or wait up to a half hour in some cases for it to happen automatically.
 
Old 08-22-2007, 11:20 PM   #8
joemadeus
LQ Newbie
 
Registered: Aug 2007
Distribution: Debian Lenny AMD64 (2.6.28.5 kernel)
Posts: 10

Rep: Reputation: 0
Farslayer, thanks for the info. Have you been able to create a switch using standard PC hardware and a Debian distro? (I noticed that you mentioned sid & etch in your personal info.) I assume I don't even need to define an interface for the two lan-side ethernet ports (i.e., no entry in /etc/network/interfaces) which means no ip address, etc.. Any tutorials, docs, howtos, etc. that you know of?

Thanks again.


-j
 
Old 08-23-2007, 12:31 AM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Never done that.. it's cheaper to just buy a switch these days.

Well a bridge is basically a two port switch, so look into setting up a bridge, A switch is basically a bridge with more than two ports...

I would suggest you start by looking at the Bridge how-to http://linux-net.osdl.org/index.php/Bridge

best recommendation I can make to you if you want to pursue making your own switch.
 
Old 08-23-2007, 09:51 AM   #10
joemadeus
LQ Newbie
 
Registered: Aug 2007
Distribution: Debian Lenny AMD64 (2.6.28.5 kernel)
Posts: 10

Rep: Reputation: 0
Thumbs up

Thanks -- good point re: setting up a bridge. You're right, of course, I gain nothing by building my own. It was mostly for the learning exercise.


-j
 
  


Reply

Tags
debian, switch, wikipedia


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 cards stoped working after Mobo switch hoglet Linux - Networking 4 05-12-2007 03:56 PM
Network not working after pc switch! Penelope Linux - Networking 7 10-25-2006 10:02 AM
--aid switch is not working with rpm command livetoday Red Hat 1 06-15-2006 10:50 AM
mozilla not working properly after switch to broadband Andrew Skinner Linux - Software 3 07-19-2005 04:59 PM
Speedtouch modem not working after switch to Xorg bugsbunny Slackware 1 05-31-2004 11:32 AM

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

All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration