0

Scenario:1

Suppose external Router R1 has interface a connected with interface b of the site Router R2. And Router R1 using IP address 80.0.0.0/8 for a. Router R2 has 4 subnets 80.0.0.0/10, 80.64.0.0/10, 80.128.0.0/10, 80.192.0.0/10. enter image description here My first question is router R1 with interface a and router R2 interface b has same ip address 80.0.0.0/8 or interface a using 80.0.0.0/8 and interface b using 80.0.0.0/10?

My second question is router R2's interface c has ip address 80.0.0.0/10?or any of the IP address of the block 80.0.0.0/10 for example 80.0.0.1/10?

Scenario:2

Suppose a host A, host B, router connected to 3 different ports of switch.Suppose host A has interface M and Mac address aaaa connected to switch port of N. enter image description here

My question is switch port interface N and host interface M could share same Mac address or switch has 3 different Mac address for it's interface N, P, Q?

S. M.
  • 358
  • 5
  • 23
  • *Router R1 using IP address 80.0.0.0/8* isn't possible since that address has all host bits set to zero. It's the network prefix and unusable as an actual interface address. *Router R2 has 4 subnets 80.0.0.0/10, 80.64.0.0/10, 80.128.0.0/10, 80.192.0.0/10* is also not possible as these subnets all overlap with 80.0.0.0/8. – Zac67 Feb 16 '22 at 13:25
  • @Zac67 If A wants to send frame to B. My question is layer2 frame from A to switch reached by port number Or Mac address? A using destination Mac of B, but A reached to switch by using port number? – S. M. Feb 16 '22 at 18:53
  • The switch receives A's frame (on port N, learns/updates A's MAC association), looks up B's MAC in its SAT/CAM, sees the association with port Q and forwards the frame out of that port. – Zac67 Feb 16 '22 at 18:58
  • @Zac67 SAT/CAM full form? – S. M. Feb 16 '22 at 19:02
  • *Source address table* and *content-addressable memory* (table). – Zac67 Feb 16 '22 at 19:07
  • @Zac67 suppose router R1 has interface a has IP address 81.0.0.1 and IP address of interface b of R2 could be any belongs to any of 4 subnets. I mean interface b has IP address could be 80.0.0.1 or 80.64.0.2 or 80.128.0.2 or 80.192.0.5? – S. M. Feb 16 '22 at 19:10
  • R1's port a and R2's port b are required to share a common subnet in order to communicate. 81.0.0.1/24 and 81.0.0.2/24 would work. OTOH, 81.0.0.1/7, 80.0.0.1/7, 80.64.0.2/7, 80.128.0.2/7, and/or 80.192.0.5/7 would also work. You might want to read up on what the subnet mask is about. – Zac67 Feb 16 '22 at 19:38
  • @Zac67 when 80.0.0.1/7, 80.64.0.2/7, 80.128.0.2/7, and/or 80.192.0.5/7 use for then it could not be overlapped with 80.0.0.1/10, 80.64.0.2/10, 80.128.0.2/10, 80.192.0.5/10 c, e, g, i interface, if I design? – S. M. Feb 16 '22 at 19:51
  • Yes, they would overlap - I was referring to those two interfaces only. All the /10 subnets are part of 80.0.0.1/7. You should really read up on [basic subnetting](https://networkengineering.stackexchange.com/questions/7106/how-do-you-calculate-the-prefix-network-subnet-and-host-numbers). – Zac67 Feb 16 '22 at 19:57
  • @Zac67 if A connected by Ethernet to switch then both interface M and N has unique Mac address? – S. M. Feb 16 '22 at 20:59
  • A switch doesn't use MAC addresses on its interfaces, a switch is transparent on layer 2. Routers and hosts use MAC addresses. And all of them must be unique. – Zac67 Feb 16 '22 at 21:18
  • @Zac67 but switch ports also transparent, why they use ports? – S. M. Feb 16 '22 at 21:23
  • @Zac67 what do you mean by Mac address transparent on layer 2? – S. M. Feb 16 '22 at 21:33
  • 1
    @Zac67 “Transparent” means that when you connect a switch to an Ethernet system, no changes are made in the Ethernet frames that are bridged – S. M. Feb 16 '22 at 22:37
  • @Zac67 router every interface has unique routing table? – S. M. Feb 18 '22 at 14:37
  • Yes, each router has its own routing table and makes its own forwarding decision. – Zac67 Feb 18 '22 at 16:05
  • @Zac67 all interface of one router has one routing table? – S. M. Feb 18 '22 at 16:06

1 Answers1

3

My first question is router R1 with interface a and router R2 interface b has same ip address 80.0.0.0/8 or interface a using 80.0.0.0/8 and interface b using 80.0.0.0/10?

80.0.0.0 is a unique address, regardless of the subnet mask. So two devices cannot have that same address. Remember though that 80.0.0.0 is not a valid host address with a mask of /8 (or /10). You could use 80.0.0.1

Interfaces a and b can be on any unique subnet. They don't have to be part of the 80.0.0.0/8 subnet.

The routing table of R1 should have a route to 80.0.0.0/8, with the next hop of interface b on R2.

My second question is router R2's interface c has ip address 80.0.0.0/10?or any of the IP address of the block 80.0.0.0/10 for example 80.0.0.1/10?

Since 80.0.0.0/10 is not a valid host address, the next available address in that subnet is 80.0.0.1

My question is switch port interface N and host interface M could share same Mac address or switch has 3 different Mac address for it's interface N, P, Q?

The switch's interfaces don't have MAC addresses. Another (old) name for a switch is a transparent bridge. It transparently forwards frames based on its MAC forwarding table. If the switch has some control or management function, such as spanning tree or a management interface, those functons will have MAC addresses

Ron Trunk
  • 66,852
  • 5
  • 65
  • 126
  • You should add that MAC addresses need to be unique within each network (=L2 segment). UAA MAC addresses are even meant to be globally unique but that isn't always the case today. – Zac67 Feb 16 '22 at 13:41
  • @Zac67 You just did :) – Ron Trunk Feb 16 '22 at 15:04
  • @RonTrunk if interface a and interface always has unique ip address? – S. M. Feb 16 '22 at 15:30
  • All interfaces **must** have unique addresses. Every house has a unique street address. Every cell phone has a unique telephone number. – Ron Trunk Feb 16 '22 at 15:32
  • @RonTrunk if router R1 has ip address 81.0.0.1/8 then interface a has unique address, then this should be 81.0.0.2,if suppose.? – S. M. Feb 16 '22 at 15:39
  • @RonTrunk router ip and it's interface should be different? – S. M. Feb 16 '22 at 15:40
  • 2
    Routers do not have IP addresses. Their *interfaces* have IP addresses. If a router has two interfaces, *each* interface has a unique address (on different subnets) – Ron Trunk Feb 16 '22 at 15:43
  • @RonTrunk if router R1 interface a has ip address 81.0.0.1/8 then it's routing table has information regarding 80.0.0.0/10 of router R2? – S. M. Feb 16 '22 at 15:48
  • @RonTrunk interface a and b also unique Mac address? – S. M. Feb 16 '22 at 15:55
  • Yes, every interface on the same L2 segment must have a unique MAC address, as Zac67 mentioned above – Ron Trunk Feb 16 '22 at 15:56
  • The routing table gets information in one of three ways: 1: The router knows its own interfaces. 2: You manually create a (static) route in the table. 3: You use a routing protocol to learn routes from other routers. – Ron Trunk Feb 16 '22 at 15:58
  • @RonTrunk in my 2nd image host A wants to send frame to switch at it respective interface N, then what would be destination Mac of A? – S. M. Feb 16 '22 at 16:09
  • What is the destination? Host B? – Ron Trunk Feb 16 '22 at 16:11
  • @RonTrunk destination is switch port N, then what is the host A using destination Mac address? – S. M. Feb 16 '22 at 16:30
  • @RonTrunk if the destination is B, then when frame forward to switch port N, what would be forwarded, since destination Mac address is host B? – S. M. Feb 16 '22 at 17:29
  • Switches forward frames transparently - that means they don't change them. [This question and answer](https://networkengineering.stackexchange.com/questions/13012/how-does-a-switch-learn-a-switch-table/13014#13014) may help you. – Ron Trunk Feb 16 '22 at 17:51
  • @RonTrunk when A sends frame then A reach to switch port N, by hosts A's port number M?I mean no need Mac address from to reach to switch N? – S. M. Feb 16 '22 at 18:10
  • If A is sending a frame for the switch itself, such as for management, then the switch has both an IP and mac address. But when you send a frame to another host, the destination is the MAC address of that host. Read the question I linked above. – Ron Trunk Feb 16 '22 at 18:13
  • @Rontrunk suppose router R1 has interface a has IP address 81.0.0.1 and IP address of interface b of R2 could be any belongs to any of 4 subnets. I mean interface b has IP address could be 80.0.0.1 or 80.64.0.2 or 80.128.0.2 or 80.192.0.5? – S. M. Feb 16 '22 at 19:22
  • Interface a of R1 and interface b of R2 are on the same L2 segment. Therefore they must have addresses in the same IP subnet. Again, that subnet doesn't have to be part of 80.0.0.0. – Ron Trunk Feb 16 '22 at 19:42
  • @Rontrunk like IP address every router has distinct Mac address? – S. M. Feb 16 '22 at 20:49
  • From the questions you're asking, it sounds like you don't really understand how two IP hosts communicate on a network. For now, I suggest you forget about switches and routers, and just concentrate on how two IP hosts communicate. You can imagine that they are connected by a simple cable. You need to understand how both MAC and IP addresses are used. – Ron Trunk Feb 16 '22 at 20:50
  • Every Ethernet interface has a unique MAC address. In theory, MACs are globally unique, but they only have to be unique on the L2 segment. – Ron Trunk Feb 16 '22 at 20:51
  • @Rontrunk if A connected by Ethernet to switch then both interface M and N has unique Mac address? – S. M. Feb 16 '22 at 20:58
  • You keep asking the same question, and my answer is the same above. A switch port does not have a MAC address. – Ron Trunk Feb 16 '22 at 22:15
  • Switches are transparent. The host doesn’t know it’s there. – Ron Trunk Feb 16 '22 at 22:18
  • @Rontrunk router every interface has unique routing table? – S. M. Feb 18 '22 at 14:36
  • No. One routing table. – Ron Trunk Feb 18 '22 at 15:02