Rostam,
When trying to do the same, see below the binary numbers for 192, 205, 207 and 208. 192 11000000 205 11001101 207 11001111 208 11010000 First to decide what type of statement we want to have: Inclusive, all networks in 1 statement but might be including networks not in the list Exclusive, all networks in possibly more statements, but never including networks not in the list. In the Inclusive case 205.49.166.0 11001101.00110001.10100110.00000000 207.49.166.0 11001111.00110001.10100110.00000000 208.49.166.0 11010000.00110001.10100110.00000000 205.49.167.0 11001101.00110001.10100111.00000000 207.49.167.0 11001111.00110001.10100111.00000000 192.49.166.0 11000000.00110001.10100110.00000000 Result of XAND 11000000.00110001.10100110.00000000 192.49.166.0 Result of XOR 00011111.00000000.00000001.00000000 31.0.1.0 or 31.0.1.255 (depending on the application) In the Exclusive case 205.49.166.0 11001101.00110001.10100110.00000000 207.49.166.0 11001111.00110001.10100110.00000000 208.49.166.0 11010000.00110001.10100110.00000000 205.49.167.0 11001101.00110001.10100111.00000000 207.49.167.0 11001111.00110001.10100111.00000000 192.49.166.0 11000000.00110001.10100110.00000000 First octet has 2 sets that only differ 1 bit (making sure that only these will be included in the statement) 205 11001101 207 11001111 205 11001101 207 11001111 Result of XAND 11001101 205 Result of XOR 00000010 2 192 11000000 208 11010000 Result of XAND 11000000 192 Result of XOR 00010000 16 Second octet has no differences anywhere. Third octet could make things more interesting, but it does not. 205.49.166.0 10100110 207.49.166.0 10100110 205.49.167.0 10100111 207.49.167.0 10100111 Result of XAND 10100110 166 Result of XOR 00000001 1 192.49.166.0 10100110 208.49.166.0 10100110 Result of XAND 10100110 166 Result of XOR 00000000 0 Now what could have made it more interesting? In the exclusive case, no other networks than the one mentioned are supposed to be in the statement. If the 192 OR 208 had .167 as its third octet, 2 statements would be needed to make the statement exclusive. Same would count for the 205 and 207 ranges if one of the 167 or 166 statements was missing. Now the last octet are all 0's, yet in the example they gave was a .255 at the end of the mask. It will depend on the application whether the mask should show .0 or .255. If the statement is used to describe the networks, then a 0 at the last octet will make sure the statement only covers the major network number and not any subnets, .255 will also include all possible subnets. If the statement is used in an ACL to allow or deny hosts in that network to send traffic, .255 will be used to cover all hosts in that network. 192.49.166.0 8.0.0.255 or 8.0.0.0 205.49.166.0 2.0.1.255 or 2.0.1.0 Just let me know if you have any questions. Kind regards, Patrick Keja -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Rostam Sohrab Sent: 22 January 2012 10:04 To: [email protected] Subject: [OSL | CCIE_RS] Network & Wildcard masks for multiple networks Sending this mail again as an attached word document to protect the format. -RS I was working on to get a network and wildcard for the below mentioned networks and I got this answer --> 192.49.166.0 4.255.1.255 which is untrue! The correct answer is 205.49.166.0 2.0.1.255 http://blog.ipexpert.com/2009/06/10/wild-card-masks/ 205.49.166.0/24 207.49.166.0/24 208.49.166.0/24 205.49.167.0/24 207.49.167.0/24 192.49.166.0/24 I'm writing the process I am following to do the ANDing and XORing operations of these networks, I'll take the first octet of all the networks. First the AND operations 208 -> 1 1 0 0 1 1 0 1 208 -> 1 1 0 0 1 1 0 1 207 -> 1 1 0 0 0 1 1 1 207 -> 1 1 0 0 0 1 1 1205 -> 1 1 0 0 0 1 0 1 192 -> 1 1 0 0 0 0 0 0 ---------------------------------------------------------------- -------------------------------------- AND->1 1 0 0 0 1 0 1 -> 208AND->1 1 0 0 0 1 0 1 ->208AND-> 1 1 0 0 0 0 0 0 -> 192 Now I am ANDing the results of first two and the result of this I'll AND with the result of third AND operation done above which is 192. 208 -> 1 1 0 0 0 1 0 1196-> 1 1 0 0 0 1 0 0 208-> 1 1 0 0 0 1 0 0192-> 1 1 0 0 0 0 0 0 ----------------------------------------------------------------- AND-> 1 1 0 0 0 1 0 0 -> 196AND->1 1 0 0 0 0 0 0 -> 192-> And hence the first octet of the network would be 192! Now the XOR operations. 208 -> 1 1 0 0 1 1 0 1 208 -> 1 1 0 0 1 1 0 1 207 -> 1 1 0 0 0 1 1 1 207 -> 1 1 0 0 0 1 1 1205 -> 1 1 0 0 0 1 0 1 192 -> 1 1 0 0 0 0 0 0 ---------------------------------------------------------------- -------------------------------------- XOR-> 0 0 0 0 1 0 1 0 ->10 AND-> 0 0 0 0 1 0 0 1 ->9AND-> 0 0 0 0 0 1 1 1 -> 7 Now I am XORing the results of first two and the result of this I'll XOR with the result of third XOR operation done above which is 7. 10 -> 0 0 0 0 1 0 1 0 3-> 0 0 0 0 0 0 1 1 9-> 0 0 0 0 1 0 0 1 7-> 0 0 0 0 0 1 1 1 ----------------------------------------------------------------- XOR->0 0 0 0 0 0 1 1 -> 3 AND->0 0 0 0 0 1 0 0 -> 4 -> And hence the first octet of the wildcard mask would be 4! So the first Octet of Network statement I get is 192 and the first octet of wildcard mask I get is 4! >>> The other question I have is about the wild card mask, in the answer it is >>> 2.0.1.255, here the second octet which has all zeros is written as a Zero >>> "0" rightly, but the last octet which is also all zeros is written as 255? >>> I found this a rather strange phenomenon!! While I am sure I am doing the AND and XOR operations correctly, I might be inadvertently deviating somewhere during the calculation! Requesting comments from all the experts in this forum. -RS _______________________________________________ For more information regarding industry leading CCIE Lab training, please visit www.ipexpert.com Are you a CCNP or CCIE and looking for a job? Check out www.PlatinumPlacement.com http://onlinestudylist.com/mailman/listinfo/ccie_rs
