1

I understand the concept of packets hopping through multiple routers to reach the destination network. I guess this has something to do with the forwarding/routing mechanism implemented in routers. What I don't understand is Datalink's hop-to-hop delivery. How do packets travel across LANs? Does every host maintain a local routing table or is that something that only routers do? I know that they do it with the help of physical addresses, but how exactly do packets know which host to go to in a LAN?

1

Data-link protocols encapsulate the IP packets into frames with the data-link protocol addressing, e.g. MAC addressing. Frames in the data-link are delivered based on the data-link addressing.

For example, an ethernet switch maintains a CAM table that relates a switch interface to each MAC address about which the switch knows. A switch will flood broadcasts, multicasts, and any unicasts for which it does not have a CAM table entry. Hosts on an ethernet LAN will ignore any frames they receive that are not destined for them.

1

I understand the concept of packets hopping through multiple routers to reach the destination network.

No offense, but I don't think you do. You need to understand the difference between layer 2 and layer 3 addresses and how they change (or don't) as a packet moves through the network.

What I don't understand is Datalink's hop-to-hop delivery. How do packets travel across LANs?

At the data link layer, there are no "hops" and no routing. Devices are addressed directly by their MAC address. Switches forward frames based on their MAC address table. If switches don't have an entry for the destination MAC, they "flood" the frame out every port.

Does every host maintain a local routing table or is that something that only routers do?

Yes, every host does, because it is assumed that it could have more than one interface. On a simple host like a PC, there is only one interface, and usually only one route (a default route).

Remember, though, that at layer 2 there is no routing, so the routing table is never used.

0

What I don't understand is Datalink's hop-to-hop delivery.

Link-layer (L2) addressing is only possible and valid within a segment - it cannot be used across hops, only in between. Hops need to share a segment between them, and they use the link layer as an intermediate transport for a packet (encapsulated in a frame suitable for the current L2 network). While IEEE-802 frames are extremely common, there are other network types as well.

How do packets travel across LANs?

LAN is usually defined as link-layer network aka broadcast domain. Packets cannot cross these networks - they need to be encapsulated in a frame for that network (e.g. in an Ethernet frame for an Ethernet network - IEEE 802.3). Many of these frame types carry L2 addresses (source & destination) and it's up to the L2 network to transport the frame to the intended local L3 recipient - either the destination host or the next-hop gateway.

IEEE networks use MAC addresses for that. Since L2 networks cannot use L3 addresses, a next-hop or destination address needs to be translated to an L2 address - using ARP for IPv4 or NDP for IPv6.

Does every host maintain a local routing table or is that something that only routers do?

While routing is the core function of a router, every host uses local routing (with its own routing table) to select one of potentially multiple NICs, and one of the gateways it knows of or direct host addressing.

In a very simple form, an end-node host has a single NIC and a single default gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.