Layer 2 switch question help!

November 1, 2010 at 10:20:36
Specs: Windows XP
Hi, I'm trying to understand how computers connected to a LAN via a Layer 2 switch communicate with eachother. Obviously the layer 2 switch only deals with mac addresses, but for the end user they don't know eachother's mac addresses. So how do computers communicate with eachother? Like if Computer A pings Computer B, how does the association between ip address and mac address take place? I've read that the computers OS keeps an arp table for future requests, but how does it get the info in the first place? And if you try to connect by hostname, that's still above layer 2, so how does association occur? I'm assuming I don't need to have a router, since the three computers are on the same subnet.
Please help, this is really stumping me...

See More: Layer 2 switch question help!

Report •

November 1, 2010 at 10:23:37
One more question... Do layer 2 switches have arp tables? Or is that only for Layer 3 and up switches?

Report •

November 1, 2010 at 10:24:28
They communicate exactly the same as a layer 1 switch.

The difference is storing of the mac table. This table assocaites a port with the attached device by mac address. When something needs to be sent, the mac address table is accessed, and only the mac address in the distination is given the data.

Review the difference between a hub and a switch for more clarification.

2nd question: what OSI layer is tcp/ip at? There's your answer.

Report •

November 1, 2010 at 10:35:41
Thank you for the quick reply!

I understand the mac address/port association. I guess my question is that when computer A user wants to talk to computer B, they're not going to know the other person's mac address, but probably their ip address (or hostname). So if you ping by ip address, how does it reach the other computer through a layer 2 switch so you get a reply?

I apoligize if I'm not making sense. Just trying to grasp what should be basic concept.

Report •

Related Solutions

November 1, 2010 at 11:24:30
I read this from wikipedia, which is why i asked if layer 2 switches had arp tables:

ARP is also very often discussed in terms of the Open Systems Interconnect (OSI) networking model, because that model addresses hardware-to-software interfaces more explicitly and is preferred by some equipment manufacturers. However, ARP was not developed based on the design principles and strict encapsulation hierarchy of this model and, therefore, such discussions create a number of conflicts as to the exact operating layer within this model. Most often ARP is placed into the Data Link Layer (Layer 2), but since it requires the definitions of network addresses of the Network Layer, it is not unusual to find it referenced at that layer.

Report •

November 1, 2010 at 11:52:51

There is the OSI model [above] and then there is the protocol model [below].

You know that line in the OSI model between layer2 and layer3? That is where ARP resides. It is neither and both.

Welcome to the complexities of IT.

Report •

November 1, 2010 at 12:13:54
Ok, so you have Computer A and Computer B, both attached to a layer 2 switch. Both computers are set up with an ip address (same subnet). Computer A pings Computer B by ip address and gets a reply. How?

Report •

November 1, 2010 at 14:33:58
v1etr1der you will need to do the research to answer that question.
I would suggest a through understanding of the OSI model would be a good start.
In your case you would want to start at the application layer [typing ping ip address at a cmd prompt] and work your way down and then backup again.

Report •

November 1, 2010 at 14:58:40
Yeah, I tried to research it but couldn't get a concise answer. The closest I got was that the computers OS has an arp table that records the ip to mac association. I read that when comp A sends out the ping, the switch broadcasts the packet with the destination ip address information in it, computer B sees it, responds to it saying "that's me" and adds the mac address info. And that creates an arp entry on the computers so it won't have to broadcast next time around. I just wanted someone to verify if this was correct and also to know if the layer 2 switch kept an arp table, since based on wikipedia, arp can be place on the data link layer (layer 2). All this information was in my original post.

I appreciate your response and help, but you actually did not answer any of my questions.

Report •

November 1, 2010 at 16:16:15
A forum is not the place to conduct computer science course. :-)

A switch does not broadcast but sends icmp. Big difference in concepts.

Just because you store layer2 information in ARP does not mean the layer2 device is storing the address information of ip. It does not.

Whree you might want to spend some time is in the tcp/ip stack and how its modified as it goes thru a switch or router.

As the saying goes "its complicated"

Best of luck!

Report •

Ask Question