-4

Suppose we have two networks connected with each other by a router. One of them is using Class A prefix and the other one is using Class B prefix in IP address.
The Question is how these two network will communicate with each other as they are using different classes of IP addressing.

MikeyB
  • 38,725
  • 10
  • 102
  • 186
Zia ur Rahman
  • 167
  • 10
  • 5
    CIDR replaced classful networking: http://serverfault.com/questions/135526/can-i-have-a-class-a-and-class-b-on-same-switch – Warner Jul 26 '10 at 17:26
  • sir, this is not my question. – Zia ur Rahman Jul 26 '10 at 17:28
  • Is the /16 within the /8? – Warner Jul 26 '10 at 17:42
  • i am a beginner, not expert like you therefore i don't understand what is /16 and what is /8. – Zia ur Rahman Jul 26 '10 at 17:46
  • 1
    /16 and /8 are the sizes of the subnet mask. A /16 network is a network with a 255.255.0.0 subnet mask. A /8 network is a network with a 255.0.0.0 subnet mask. These are equivalent of what used to be a Class B and a Class A network respectively. – Jason Berg Jul 26 '10 at 18:00
  • 2
    If you read through the page in the first comment, and links from there - specifically this http://serverfault.com/questions/49765/server-fault-wiki-how-does-subnetting-work/49836#49836 you'll understand why your question doesn't really make sense. – Whisk Jul 26 '10 at 18:01
  • i have told you, that i am beginner , you need to answer what i am asking, i have not read about what is mask and what is subnet yet. so please try to answer what i am asking , please address my question, if you can't then please don't post unrelated comments and answers. – Zia ur Rahman Jul 26 '10 at 18:03
  • 3
    @Zia: you **need** to read about and understand masks and subnets in order to understand any answer to your question. – Ward - Reinstate Monica Jul 26 '10 at 18:10
  • ok sir i am going to listen the lecture about subnets. – Zia ur Rahman Jul 26 '10 at 18:14
  • Smells like homework. – Chris S Jul 26 '10 at 18:28
  • possible duplicate of [connecting two networks by a router](http://serverfault.com/questions/163713/connecting-two-networks-by-a-router) – Chris S Jul 26 '10 at 18:33
  • Downvote for homework. – DanBig Jul 26 '10 at 18:41

4 Answers4

5

That is why you need a router in between, the router will have interfaces on both networks and will be able to pass packets between the two networks.

topdog
  • 3,490
  • 16
  • 13
  • does router will convert the class A addresses into class B addresses and vice versa – Zia ur Rahman Jul 26 '10 at 17:25
  • for example when network using class A addressing sends a message to network using class B addresses, what will router do? router will convert the Class A address to class B address? – Zia ur Rahman Jul 26 '10 at 17:27
  • 1
    The router will use the address on what ever network to talk to that network no conversion takes place – topdog Jul 26 '10 at 17:31
  • the router will use the address on what ever network to talk to taht network no conversion takes place, i could not understand this statement. – Zia ur Rahman Jul 26 '10 at 17:34
  • To connect the two networks the router has to have interfaces with addresses on each network. – topdog Jul 26 '10 at 17:36
  • either its not correct english, that is why its confusing me, or its very complex english. – Zia ur Rahman Jul 26 '10 at 17:36
  • @ Zia ur Rahman, see @Jason Berg's reply. Classful addressing is dead and gone. Even back when it was in use there was no "conversion". The router simply routed as appropriate. It appears that you have some fundamental misconception about IP that I don't even know how to begin to correct. You might want to try some basic IP networking manual to get up to speed. – Brian Knoblauch Jul 26 '10 at 17:37
  • my dear sir ok classful addressing is dead and gone now , but i want to understand it, so please answer my question if you can. – Zia ur Rahman Jul 26 '10 at 17:41
  • To connect the two networks the router has to have interfaces with addresses on each network (interfaces with addresses on each network ) not understandable – Zia ur Rahman Jul 26 '10 at 17:43
3

Classful IP addressing is no longer being used. At all. Don't worry about it. I wish everybody would purge the terms "Class A" "Class B" and "Class C" from their memory. They are not needed at all. What's used now is Classless Inter-domain Routing. Notice it is classless in that there are no longer different classes of IP addresses (with exceptions like multicast and private IP addresses)

If you have valid subnets with a properly configured router, traffic will flow. All the router needs to know is its IP addresses on networks A and B along with the subnet masks. If it knows those, it will route data (provided you're not doing any sort of traffic filtering or NAT)

Jason Berg
  • 18,954
  • 6
  • 38
  • 55
  • ooo sir , this is not my question. – Zia ur Rahman Jul 26 '10 at 17:38
  • 2
    This may not have been your question, but I'm saying your question is very outdated. There is no need to pull the terms "Class A" or "Class B" into a modern conversation about networking. The value of the first octet (which is what you're talking about with classful IP addressing) does not matter as long as it is not reserved for another purpose. Maybe a better question to ask would be "Will a /8 network be able to communicate with a /16 network through a router" – Jason Berg Jul 26 '10 at 17:45
  • sir i am a student a student, our teacher taugh us about this classful addressing, now i need to understand it, Because without understanding this i can not understand that why this classful addressing is obsolete now. – Zia ur Rahman Jul 26 '10 at 17:49
  • The reason Classful addressing is obsolete now is because it wasn't flexible enough. An organization was only able to obtain blocks of addresses that were either Class A (~16 million addresses), Class B (~65,000 addresses) or Class C (256 addresses). If an organization needed 1,000 addresses, they were given 65,000 because that's all that was allowed. This wasted many addresses. Now if an organization needs 1000 addresses, they can get a /22 network which is about 1022. There's much more flexibility. – Jason Berg Jul 26 '10 at 18:04
  • again i will say, you need to answer what i am asking, if you can't then please don't post unrelated answers and comments,its my request to you. i will appriciate a comprehensive and understandable answer. – Zia ur Rahman Jul 26 '10 at 18:10
  • 3
    Teachers should not be teaching Class anymore, there's no excuse; they've been outdataed for 16 years. CIDR replaced them and there's no benefit to learning the Classes except to know the history. Also, this is not a 'Do my homework for me' site. – Chris S Jul 26 '10 at 18:31
  • @ChrisS Sorry to resurrect this old post, but just FYI: One of the reasons classful addressing is still being taught (2 years later) is because it's still in the CISCO CCNA curriculum. My uni lecturer told us directly that the only reason he teaches us classful addressing and EIGRP is because CISCO require it. – Cam Jackson Nov 13 '12 at 10:00
1

OK. I'll take another shot at this. Here is how a Class A (network with the first octet being 0 and 127 and also having a 255.0.0.0 subnet mask) network can communicate with a Class B (network with the first octet being between 128 and 191 and also having a 255.255.0.0 subnet mask) network.

A packet originates on a device in network A. This packet is sourced from IP address 10.0.1.2 and destined to IP address 172.16.1.2. The source device first checks the destination IP address. It compares this information to the information in its own routing table. The only entries of note in its routing table are the local subnet (10.0.0.0 with a 255.0.0.0 subnet mask) and it's default gateway (0.0.0.0 with a 0.0.0.0 subnet mask with a next hop of 10.0.1.1). Since the packet doesn't match any entry in its routing table besides the default route, it sends it to the default gateway, which is the router.

The router takes this packet and does the same thing. It examines the destination IP address and compares it to its routing table. The router has multiple local interfaces to compare to. It has a local network of 10.0.0.0 with a subnet mask of 255.0.0.0 and a local network of 172.16.0.0 with a subnet mask of 255.255.0.0. The router matches the destination address with the second routing table entry and directs it out the interface connected to that network. That interface looks up the MAC address for 172.16.1.2, creates a frame, and sends it out the proper interface.

The class of the networks don't really matter. The only thing that matters is that the router has an entry in its routing table that will match the destination IP address of the packet.

Jason Berg
  • 18,954
  • 6
  • 38
  • 55
0

If two different hosts are on the SAME NETWORK, they can talk directly.

If two different hosts are on DIFFERENT NETWORKS, they need a router to pass packets.

Example:

  • Host A: 10.0.0.42 is on network 10.0.0.0/8 (a.k.a. a Class A network)
  • Host B: 172.16.0.42 is on network 172.16.0.0/12 (a.k.a. a Class B network)
  • Host C: 11.0.0.42 is on network 11.0.0.0/8 (a.k.a. a class A network)

Since A and B are on different networks, they need a router to talk.

Since B and C are on different networks, they need a router to talk.

Since A and C are on different networks, they need a router to talk.

The prefix length of a network (we used to call it Class) makes NO DIFFERENCE to whether two hosts can talk. The difference is in the network.

MikeyB
  • 38,725
  • 10
  • 102
  • 186