[SOLVED] Question about packet switching

Forfex

Prominent
Oct 7, 2021
6
0
510
Hi everyone,
I have a question about how packet switching works, and I'm going to refer to the image posted below. Let's say that the computer "host 1" wants to communicate with computer "host 2". So a packet is sent from host 1 to its default gateway, which is router 1. Now router 1 has to change the frame, i.e. has to change the mac address with the mac address of the next node of the network, so that the data can be forwarded to that node and so on until it gets to host 2. My question is: how does router 1 knows which the next router (in this case, it should be router 2) to send the data to is? And, consequently, how does the next router (i.e. router 2), knows who to send the data to, and so forth... ? Thanks to everyone who responds.

 

kanewolf

Titan
Moderator
Hi everyone,
I have a question about how packet switching works, and I'm going to refer to the image posted below. Let's say that the computer "host 1" wants to communicate with computer "host 2". So a packet is sent from host 1 to its default gateway, which is router 1. Now router 1 has to change the frame, i.e. has to change the mac address with the mac address of the next node of the network, so that the data can be forwarded to that node and so on until it gets to host 2. My question is: how does router 1 knows which the next router (in this case, it should be router 2) to send the data to is? And, consequently, how does the next router (i.e. router 2), knows who to send the data to, and so forth... ? Thanks to everyone who responds.

Router 4 has to advertise the addresses it supplies. Router 3 can forward those routes to router 2. And so on. Those routes might be a class A or B subnet for the core internet routers.