2 Networks on one switch

duladula Member Posts: 18 ■□□□□□□□□□
Hi, everyone,

Suppose I have two networks, 192.168.1.0/24 and 192.168.2.0/24 served by one switch. Then based on my knowledge, ordinary switches operate at Data Link Layer and so won't bother about IP addresses.

This would mean that a broadcast frame sent by a host on one network will be seen by hosts in other networks and it is possible to access hosts in the other networks without vlans.

Is my assumption correct.

icon_eek.gif


dula

Comments

  • Deadmaster200Deadmaster200 Member Posts: 145
    If you mean you have 2 hosts connected to a switch and you have set their IP addresses to be on different networks, they won't communicate. How can they if they are on 2 logically different networks? Whether they are connected through a switch, hub, or directly connected is irrelevant.
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    dula wrote:
    Hi, everyone,

    Suppose I have two networks, 192.168.1.0/24 and 192.168.2.0/24 served by one switch. Then based on my knowledge, ordinary switches operate at Data Link Layer and so won't bother about IP addresses.

    This would mean that a broadcast frame sent by a host on one network will be seen by hosts in other networks and it is possible to access hosts in the other networks without vlans.

    Is my assumption correct.

    icon_eek.gif


    dula

    Yes, you are correct, hosts on different ip networks will receive broadcasts frames from each other, the broadcasts will be sent to a Mac address FF.FF.FF.FF.FF.FF which means all stations on the broadcast segment will receive the frames unencapsulate them and send them to the ip layer.If you sent an ip broadcast to 192.168.1.255, a machine on 192.168.2.0/24 network will receive the broadcast, unencapsulate the layer 2 and send it to layer 3,since it is on a different subnet the ip layer will discard the packet.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • duladula Member Posts: 18 ■□□□□□□□□□
    If you mean you have 2 hosts connected to a switch and you have set their IP addresses to be on different networks, they won't communicate. How can they if they are on 2 logically different networks? Whether they are connected through a switch, hub, or directly connected is irrelevant.

    My understanding is that switches operate at the Data Link Layer, so they really shouldn't care about the IP address. If for example I try to ping from host A in network 1 to host B in network 2, then the first thing host A will do is to get the MAC address of host B.

    It does this by sending broadcast frame to broadcast address 255.255.255.255, in this case. This frame is presumably picked by all the hosts, even the ones on the other network (192.168.2.0/24) since they have same broadcast address. Therefore, host B will respond with its MAC address and the ping will succeed.

    Maybe I'm wrong, could someone please clarify. What exactly prevents two hosts from diffrent networks from communicating?
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    dula wrote:

    Maybe I'm wrong, could someone please clarify. What exactly prevents two hosts from diffrent networks from communicating?

    Which part of my reply was unclear? icon_confused.gif
    The hosts are on a different logical ip subnet so they cant communicate at layer 3, they can communicate at layer 2 but not layer 3.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • duladula Member Posts: 18 ■□□□□□□□□□
    EdTheLad wrote:
    dula wrote:

    Maybe I'm wrong, could someone please clarify. What exactly prevents two hosts from diffrent networks from communicating?

    Which part of my reply was unclear? icon_confused.gif
    The hosts are on a different logical ip subnet so they cant communicate at layer 3, they can communicate at layer 2 but not layer 3.

    I was refering to Deadmaster200's post. thanks, I've understood the concept :)
  • Paul BozPaul Boz Member Posts: 2,620 ■■■■■■■■□□
    [edit]

    Ed already explained it so I'm not going to beat a dead horse.
    CCNP | CCIP | CCDP | CCNA, CCDA
    CCNA Security | GSEC |GCFW | GCIH | GCIA
    pbosworth@gmail.com
    http://twitter.com/paul_bosworth
    Blog: http://www.infosiege.net/
  • Deadmaster200Deadmaster200 Member Posts: 145
    Yes, Ed went to the trouble of explaining it in better detail than I did.

    Of course there are other technologies/methods to communicate so let me rephrase:

    (If you mean you have 2 hosts connected to a switch and you have set their IP addresses to be on different networks, they won't communicate. )

    BECOMES

    If you mean you have 2 hosts connected to a switch and you have set their IP addresses to be on different networks, they won't have IP connectivity.

    And one more thing: You are right, the switch doesn't care about the IP layer, but the hosts definitely do! And that's what I meant by it doesn't matter how exactly they are connected.
  • Aquabat [banned]Aquabat [banned] Inactive Imported Users Posts: 299
    they would still both recive broadcasts, arp requests, DHCP from eachother, unless they are in different vlans
    i herd u leik mudkips lol
  • ilcram19ilcram19 Inactive Imported Users Posts: 206
    lol dat sound ridicules, come on try to put to computer together using a crossover see if the will comunicate just using datalink layer, refer to the osi layer please, the network layer is responsible for end to end (source to destination) packet delivery, so how can u comunicate with jus data link layer
    If you stop getting better, you cease being good
  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    ilcram19 wrote:
    lol dat sound ridicules, come on try to put to computer together using a crossover see if the will comunicate just using datalink layer, refer to the osi layer please, the network layer is responsible for end to end (source to destination) packet delivery, so how can u comunicate with jus data link layer

    Have you ever used NetBEUI? All broadcasts my friend, no IP address or layer 3 needed. The switch will happily pass the packets (as broadcasts) and the 2 computers will have fun sharing files.

    Oh yes, I know it's an old protocol and never really used anymore, but before you laugh at someone's question remember none of us knows everything. He had a good question, since the switch sees all the traffic he wondered if the computers should be able to communicate. Ed got him in the right direction.
    All things are possible, only believe.
  • ilcram19ilcram19 Inactive Imported Users Posts: 206
    lol i wasnt lafting at the question, he was talking about logic addressing too, i repect they opinion cuz the people over here helped me alot...plus this is ccna, dont get them confuse with the NetBEUI cuz its no cover on the test plus is not even part of cisco, i apologize if there was any misundertestending,
    If you stop getting better, you cease being good
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    ilcram19 wrote:
    the network layer is responsible for end to end (source to destination) packet delivery, so how can u comunicate with jus data link layer
    Indeed, responsible for 'packet' delivery. Network nodes can communicate with each other on the physical layer with electrical signals and on the datalink layer with frames. And since switches forward broadcasts, all the devices on the switch (and in the same vlan) 'are' communicating with each other on the physical and data link layer. The point is that they 'have' to process the incoming ip directed broadcast through layer 1 and 2 before they can determine whether the traffic is actually addresses to them. At that point they already communicated on layer 1 and 2. Even if the TCP/IP stack isn't running on the receiving nodes, it still has to go through layer 1 and 2 to find out it's TCP/IP.

    Besides that, take for example a layer 2 protocol like CDP that needs only needs and active data link (and hence physical layer) to be able to communicate. You mentioned the OSI model yourself, but knowing each layer in the OSI model communicates with the layer above it, below it, and the same layer at the other node. The network layer and packets is just one of the many types of communication.
  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    ilcram19 wrote:
    ...plus this is ccna, dont get them confuse with the NetBEUI cuz its no cover on the test plus is not even part of cisco, i apologize if there was any misundertestending,

    Neither is connecting 2 computers through a cross over cable. But any kind of packets that traverse a network, and therefore cisco devices, is part of real world networking.
    All things are possible, only believe.
  • ilcram19ilcram19 Inactive Imported Users Posts: 206
    Neither is connecting 2 computers through a cross over cable

    lol yes it does i just took the intro exam and i had a question related to it

    and yes you make alot of sence webmaster but
    [/quote]Suppose I have two networks, 192.168.1.0/24 and 192.168.2.0/24 served by one switch. Then based on my knowledge, ordinary switches operate at Data Link Layer and so won't bother about IP addresses.[/quote]
    based in dat he has to separte networks in diferent subnets so they wont comunicate unless they have a router or the switch that is layes 3, i mean we know physical layer is workin and data link layes is doing it job of moving the frames around the switch, but unless it has a router oh changes all the host to the same subnet they wont comunicate
    im not saying you wrong but im just refering to the info he provide
    [/quote]
    If you stop getting better, you cease being good
  • rossonieri#1rossonieri#1 Member Posts: 799 ■■■□□□□□□□
    dula wrote:
    This would mean that a broadcast frame sent by a host on one network will be seen by hosts in other networks and it is possible to access hosts in the other networks without vlans.

    Is my assumption correct.

    icon_eek.gif


    dula

    this is a 2x2 answers question :
    1. This would mean that a broadcast frame sent by a host on one network will be seen by hosts in other networks?

    answer : not really? if you have no vlan the answer is correct.
    but if you have VLAN : VLAN is an L2 separation - dont care what MAC address you query - if you reside on different VLAN that query will never get thru. that directed broadcast still inside the VLAN - because each VLAN has its own MAC table which stored in the switch.


    2. it is possible to access hosts in the other networks without vlans?
    answer : still 1/2 correct. what kind of access you mean?
    if you are talking end-to-end that is impossible -- you need a router to connect different ip networks. but if you said L2 connectivity then you are correct.

    hope this help,

    cheers.
    the More I know, that is more and More I dont know.
Sign In or Register to comment.