x -> standard
y -> extended
Routers use a process called packet forwarding to determine which local IP address a data packet is intended for. When a packet arrives at a router, it examines the destination IP address in the packet header and compares it to its routing table, which contains a list of local IP addresses and their corresponding ports. If the destination IP matches a local device's IP, the router forwards the packet to that specific device within the local network. Additionally, routers utilize protocols like ARP (Address Resolution Protocol) to map IP addresses to MAC addresses, ensuring proper delivery within the local network.
The Destination Address (Layer 2 or Layer 3)
In packet routing, MAC addresses (Media Access Control addresses) change at each hop between different network segments, as they are specific to the local network's data link layer. When a packet traverses from one network to another, the source MAC address will be that of the sending device, and the destination MAC address will be that of the next device in the path, typically the router's interface. This process continues until the packet reaches its final destination, where the MAC address will correspond to the end device on the local network. Thus, while the IP address remains constant throughout the journey, the MAC addresses change at each segment.
the router will enqueue the packet that is sent to the destination 192.168.1.4.and then that packet is sent on transmission media(cable).it checks every ip address that is holding the ip same as the destination ,if it reaches there then it deleiver it on that machine.
The router discards the packet. The router forwards the packet via the default route
First, routing is the process a router performs when making forwarding decisions for each packet arriving at the gateway interface. To forward a packet to a destination network, the router requires a route to that network. If a route to a destination network does not exist on the router, the packet will be forwarded to the default gateway. Now, the destination network can be a number of routers or hops away from the default gateway. If the router has an entry for the network in its routing table, it would only indicate the next-hop router to which the packet is to be forwarded to and not the exact route to the final router. To sum it up, the routing process uses a routing table to map the destination address to the next hop and then forwards the packet to the next-hop address.
Router uses IP address of destination node to do the direct packet switching..while bridge & switch uses the MAC address to packet forwarding.
First, routing is the process a router performs when making forwarding decisions for each packet arriving at the gateway interface. To forward a packet to a destination network, the router requires a route to that network. If a route to a destination network does not exist on the router, the packet will be forwarded to the default gateway. Now, the destination network can be a number of routers or hops away from the default gateway. If the router has an entry for the network in its routing table, it would only indicate the next-hop router to which the packet is to be forwarded to and not the exact route to the final router. To sum it up, the routing process uses a routing table to map the destination address to the next hop and then forwards the packet to the next-hop address.
--> If the destination network is directly connected, the router forwards the packet to the destination host. --> If no route exists for the destination network and a default route is present, the packet is forwarded to the next-hop router. --> If the originating host has a default gateway configured, the packet for a remote network can be forwarded using that route.
packet-filtering
It uses the MAC address, Media Access Control. Every packet sent from a computer contains its MAC address. The router stores this in its routing table. When it receives a packet with a destiation address of that MAC address, then it forwards it to that computer. This is called NAT, Network Address Translation. It uses the Destination IP address
Route table lookup