2

I have the following question confused, we suppose: in my lab I have 10 linux servers and one layer-2 switch, I tried to separate them to 5 groups:

Group one:   10.1.1.0/24  include server1(10.1.1.2), server2(10.1.1.3)
Group two:   10.1.2.0/24  include server3(10.1.2.2), server4(10.1.2.3)
Group three: 10.2.0.0/16  include server5(10.2.2.2), server6(10.2.2.3)
Group four:  10.3.0.0/16  include server7(10.3.2.2), server8(10.3.2.3)
Group five:  10.0.0.0/8   include server7(10.5.2.2), server8(10.5.2.3)

So, in each group the two servers should be able to communicate very well? and also, all of the 10 servers can talk to each other very well, right?

1
  • 1
    It's Layer 2, not Level 2.
    – Ron Maupin
    Feb 6, 2019 at 21:01

2 Answers 2

5

So, in each group the two servers should be able to communicate?

Yes.

And also, all of the 10 servers can talk to each other, right?

No. Because your groups are in different subnets, they will not be able to communicate. In order to communicate from one subnet to another, you need a router.

The problem has less to do with the switch, and more with your addressing plan.

4
  • hi Ron, thank you. I can understand group1 can't talk to group2. But why group1 can not talk to group5, or group5 can't talk to group1? I think group5 is /8 subnet witch includes /16 and /24, why they can not talk to each other either please?
    – Jack
    Feb 6, 2019 at 19:57
  • Group 5 can send packets to group 1, but group 1 won't reply because the destination (10.5.2.2 is not in group 1's subnet.
    – Ron Trunk
    Feb 6, 2019 at 19:58
  • that means Group1 can receive and read Group5's messages, but Group1 cannot or say will not send message back to Group5, right please?
    – Jack
    Feb 6, 2019 at 20:06
  • To be specific, IP packets sent to group1 will be received, but no packets can be sent to group 5. If you intended to send messages via any application using TCP, for example, they would fail.
    – Ron Trunk
    Feb 6, 2019 at 20:17
2

Can Layer-2 Switch deal with different Segmented IP

Your problem is not related to the layer-2 switches at all:

A layer-2 switch is only interested in the destination MAC address of an Ethernet frame; for the layer-2 switch the (destination) IP address of the IP packet is nothing but some bytes of the data being sent.

Group one:   10.1.1.0/24  include server1(10.1.1.2) ...
...
Group five:  10.0.0.0/8   include server7(10.5.2.2) ...

... and also, all of the 10 servers can talk to each other very well, right?

With a high probability server 7 would be able to send packets to server 1, but server 1 would not be able to send packets to server 7:

If server 7 shall send some IP packet to server 1, it will check if the address of server 1 lies in the address range of its own "group". 10.1.1.2 is in the address range 10.0.0.0/8, so server 7 will assume that server 1 is a member of "group five".

Therefore server 7 will broadcast an ARP packet to all computers in the Ethernet network. This packet contains the "ARP request" that 10.5.2.2 wants to know the MAC address of 10.1.1.0. Server 1 will answer with an ARP packet containing the own MAC address. (I'm not 100% sure if server 1 will check if server 7 is part of "group one". I'm assuming that server 1 will not check this.)

Now server 7 knows the MAC address of server 1 and it can send IP packets to that server.

However, if server 1 wants to send IP packets to server 7, it will find out that 10.5.2.2 is not within the range 10.1.1.0/24 and therefore server 7 is not a member of "group one".

Therefore server 1 will assume that server 7 cannot be reached "directly" over Ethernet but that it can only be reached using some router in between.

If the routing configuration of server 1 does not contain information about a router whose address is in the range 10.1.1.0/24 and which is able to forward packets to server 7, the operating system of server 1 will refuse to send any IP packets to server 7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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