Forum Moderators: open

Message Too Old, No Replies

who can ping who? a test

how much do you remember about subnetting?

         

youfoundjake

9:17 pm on Jul 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Pc1
Ip address:192.168.1.10
Subnet:255.255.0.0

Pc2
Ip address:192.168.0.10
Subnet:255.255.255.0

Can pc1 ping pc2?
Can pc2 ping pc1?
Neither pc can ping each other?

jdMorgan

9:46 pm on Jul 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Trick question? OK, I'll have a go: PC1 can 'see' PC2, because PC1's subnet includes 192.168.x.x. PC2 however can't see outside the .0.x address range, because that is the limit of it's 256-address subnet.

Jim

youfoundjake

9:55 pm on Jul 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To be honest, not sure if its a trick question, it was posed to me...
I think you are correct though, I came to the same conclusion about the subnet mask also...

Dabrowski

10:36 pm on Jul 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok, here's how subnetting works....

You have to convert everything to binary, so lets take the first pc:

192.168.1.10 = 11000000 10101000 00000001 00001010 
255.255.0.00 = 11111111 11111111 00000000 00000000

(extra 0 added for alignment purposes!)

The bits in the subnet mask have to be contiguous, that is you could never have some 0's and then some more 1's. So valid values for the last mask byte are 128, 192, 224, 240, 248, 252, 254 and 255.

Now, notice I've boldened the corresponding bits in the IP address? The IP address is now split into the network and subnet portions.

When PC one tries to access an address, it first compares the bits in the network portion. If they are the same as its own then the PC should be on the same subnet, and no routing is needed. If they are different then the router will be contacted first.

So, lets look at the second PC:

192.168.000.10 = 11000000 10101000 00000000 00001010 
255.255.255.00 = 11111111 11111111 11111111 00000000

If you compare the network portion of each address you should now see that PC1 will contact PC2 directly, but PC2 will try to use a router to get to PC1.

The answer? You are almost correct, PC1 would appear to be able to ping PC2.

However....it would appear to be a trick question. If you did this in reality PC1 would send a ping to PC2. PC2 would recieve the ping, but it would not be able to send a reply, so the ping test would fail.

Sorry for being over-techie!

[edited by: Dabrowski at 10:38 pm (utc) on July 14, 2008]

youfoundjake

1:49 am on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks,
I would imagine the above would hold true on a hub, or a router with static mapping?

jdMorgan

1:56 am on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The ping should work with a hub, but won't work with a router. Hubs are just 'bit repeaters' -- sending everything they receive on any port to all their other ports, while routers ... well, they route -- based on the destination IP address in the TCP/IP message. Hubs don't look at the message at all, they just repeat it bit-for-bit.

Jim

Dabrowski

6:53 pm on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hold true on a hub, or a router with static mapping

This holds true for the entire internet, and all private IP networks in the world ever.

Some definitions....

hub: as jdMorgan says, recieves a packet on any port, and repeats it to all others.

switch: like hubs but more intelligent. They learn what IP is on which port so only relevant ports need recieve any given packet. Switches have an 'uplink' port (normally port 1). Anything that the switch doesn't know where to send gets shunted to the uplink. Normally a network won't work properly unless the uplink is connected to the next step in the network chain, a router for example.

router: This really just bridges any 2 (or more networks). Pretend you have 2 networks, 192.168.0.x and 192.168.1.x. Neither can see each other, but connect a router to both and it will send network packets between when necessary.

Your network layout would have your pc's connected to a switch along with a wireless access point, the uplink port on the switch connected to the router, the router connected to the next gateway, maybe an asdl router, or even another higher level switch.

Most home networks have an adsl modem with built in switch and/or wireless. This is really a separate wap, switch, router and adsl modem all rolled into one, and internally connected as described above.

Sorry again for being too techie!

youfoundjake

10:16 pm on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hub works on the 1st layer
Router on the 3rd
Switch is on the second layer
Osi model i believe...

Dabrowski

11:58 am on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Really, don't get me started on that.

jdMorgan

12:17 pm on Jul 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BTW Dabrowski, nice posts above.

For those who want to dig into the details, the bitmask diagrams above and the cited values for bitmasks can be clarified by reference to a binary-to-decimal number translator, and some basic Boolean logic operations, such as AND and NOT. For example, network address = (IP address) AND (bitmask), subnet address = (IP address) AND NOT(bitmask).

Jim

SEOMike

4:23 pm on Jul 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have two wireless networks and they don't work quite how I want.

Wireless router 1 assigns DHCP addresses in the 192.168.1.x range. It is the main router that is hooked up to my T-1 and has a static IP. All the home computers hook up to this router through Ethernet including an additional wireless router so I can use my laptop upstairs / outside.

Wireless router 2 gets an address in the 192.168.1.x block through DHCP from router 1. Router 2 assigns a DHCP address to my laptop of 192.168.2.x. When I'm connected to router 2 I can't see any other computers / printers. Both are in the 255.255.255.0 subnet.

Any way I see the LAN computers and printers from router 2?

Dabrowski

9:14 pm on Jul 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mike,

Router 2 is giving address of 192.168.2.x, but somewhere you'll need a router or bridge to connect the 1.x and 2.x subnets. Just because you can give a PC an address by DHCP doesn't mean it will actually talk on the network.

You'll need to check that router 2 is assigning a default gateway address of 192.168.2.1 (assuming that .1 is router 2's address). It should then bridge the networks correctly.

You may also want to check the DNS address, you may be able to access things via IP address but not by name.

Try [66.102.9.104...] (Google). If that works then DNS is your problem.

Chris.

Dabrowski

8:40 pm on Jul 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, a thought. Are your wireless 'routers' really routers?

They may be wireless access points (usually wireless with one RJ45 on the back), in which case they will not bridge networks. Now, obviously I can't know the spec of your particular model, but my experience with these is that if you disable DHCP they will pass an address from the main network.

So, disable DHCP on router2. Then when a wireless client connects, router2 requests a dhcp address on the clients behalf. All devices are then on 1.x subnet and all happy.

In that scenario it is not even necessary for router2 to be able to participate in the network, it could have an invalid address itself and your wireless clients would still work.

Another alternative is to split the DHCP pool between the 2 routers.

Rugles

9:20 pm on Jul 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is some valuable information Dabrowski. I am bookmarking this thread. Thanks,

Dabrowski

11:48 am on Jul 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Rugles! Actually web authoring is a side line for me, so this is the stuff I'm really good with.

SEOMike, did you manage to sort out your problem?