Forum Moderators: open
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]
Jim
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!
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
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?
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.
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.