3
  1. Can a LAN be implemented just with a switch?

    If so,how is the communication completed?just by MAC addresses?

  2. When sending a frame from the source to the destination,and inbetween there is a switch,what will the MAC address for destination be?

Thanks for answering!

  • 1
    "If so,of course no IP addresses exist" Why do you think that? There could be a DHCP server on the LAN, that doesn't depend on a router, and you can statically configure addresses on the hosts. Even if you do not have a DHCP server or statically configured hosts, they should configure themselves with link-local IP addresses. Routers route traffic between LANs, and traffic from one host to another host on the same LAN does not use a router. – Ron Maupin Jan 25 at 6:05
  • Correct,i was just trying to say that the IP addreses aren't a must-use in a LAN working just with MAC addressing. – Some1 Jan 25 at 8:01
  • Each network layer in a source host communicates with the corresponding layer in the destination host. An application sends data to the transport layer, which encapsulates it and sends it to the network layer, which encapsulates it and sends it to the data-link layer, which encapsulates it and sends it to the physical layer for encoding into bits on the wire. The destination host reverses the process. For an application to communicate with an application on a different host, it uses the layers in the network stack, so you really need the addressing at all the layers for useful communication. – Ron Maupin Jan 25 at 16:23
4

Can a LAN be implemented just with a switch?

Yes.

For hosts on the same LAN, a router serves no purpose. Routers route packets between networks, not from a network back to the same network.

Hosts on a LAN can get IP addressing from a DHCP server, be statically configured, or configure themselves with link-local IP addressing.

just by MAC addresses?

No. Traffic delivered on a LAN is delivered by the layer-2 LAN addressing (MAC addresses for IEEE LAN protocols, e.g. ethernet), but the network stack will still have addressing for the other layers in the stack, such as the layer-3 (IPv4, IPv6, etc.) and layer-4 (TCP, UDP, etc.) protocols.

When sending a frame from the source to the destination,and inbetween there is a switch,what will the MAC address for destination be? (Again,no router in the LAN)

Again, a router plays no part in traffic sourced and destined for the same LAN. Frames are addressed with the source and destination host layer-2 addresses. Switches are transparent devices. On ethernet, the source MAC address on a frame is the source host's MAC address, and the destination MAC address on a frame is the destination host's MAC address. Only frames destined to the management interface of a switch (as a host on the LAN) would be addressed with a MAC address of the switch, otherwise, the hosts do not even know the switch exists.

  • So the MAC address of the switch is only used for its management? – Some1 Jan 25 at 8:58
  • @Zach Not only for management. Beyond that, if the switch supports one of the spanning-tree or similar topology control mechanisms, it must be able to generate BPDU frames, and these need a (source) MAC address, too. Also hello/discovery packets for LACP need a source MAC address, flow control, LLDP, CDP and the likes, as well. These are all advanced functions of a switch. For the basic task of learning MAC addresses, populating the CAM table and forwarding ethernet frames appropriately, a switch does not need a MAC address, indeed. – Marc 'netztier' Luethi Jan 25 at 13:21
2
  1. Can a LAN be implemented just with a switch?

Yes. Alternatively, just using a repeater hub. Using obsolete coax Ethernet (10BASE5 and 10BASE2) you don't even need a hub, just a common cable.

With just two nodes you can even run a simple cable between them with any Ethernet variant (though some might argue that isn't a "LAN" yet).

If so,how is the communication completed?just by MAC addresses?

Ethernet and similar standards operate on MAC addresses, yes. Most often, there's also TCP/IP on top of the LAN network (physical layer and data link layer).

When sending a frame from the source to the destination,and inbetween there is a switch,what will the MAC address for destination be?

The source node sets the desired destination MAC in the frame and the network transports it from source to destination. Repeater hubs just transport each frame everywhere (except back to the source), switches automatically learn the distribution of MAC destinations on the network and forward each frame accordingly.

A router is what you require to connect your LAN with something else - another LAN, the Internet, ... With a router you also need to use a routable layer-3 protocol like IPv4 - nearly always there's an IP network anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.