Packet and Frames passing through hub, switches and routers

Hi All,
Could someone help clarify how a host lets say "A" would communicate with host "B" on the same subnet, but has to pass through hubs and switches and doesn't know where "B" is. In terms of ARP, since only hubs and switches are involved would only be interested in MAC addresses, right? In this scenario no routers are involved.

Second scenario would be the same, except, now lets add that router, and connect multiple subnets. now host "A" wants to communicate with host "C" on a separate subnet, through hubs, switches and a router.

I'm assuming layers 1 2 and 3 are involved, ARP, IP and MAC addresses.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ethernet communications are broken up into small chunks called frames.
Each frame contains a 'destination' and 'source' hardware address, the data, and a checksum.

When a hub or multi-port repeater receives an Ethernet frame, it simply forwards the frames out all ports other than the one it came in on:  unless a collision has occured.
When a collision occurs a "collision jam"  signal is sent across the collision domain, by the device that detected the collision.

A collision occurs when two devices in the same collision domain attempt to transmit at once: after a collision, all hosts on the network stop transmitting for a random backoff time.

_ALL_  devices connected directly to a hub see traffic that successfully
passes into any port on  that hub  (hubs are generally dumb multiport
repeaters, that merely regenerate the communication that arrived,
and have no intelligence).

Bridges, switches, and routers can be used to separate collision domains.  Fewer collisions  means better throughput.

When a typical modern switch  (called a learning switch) receives a frame,  it examines the source address of the frame, and stores that hardware address
as associated with the source port.

The table entries expire after an aging period, but will be kept so long as the host is generating traffic.

If the switch doesn't know which port to send a frame to, because the destination
hardware address is not in its table, it forwards it to all ports except the one it came in on.

A switch does the same for broadcast traffic.
If the port of the hardware destination address is known, then the frame is sent out that port (unless it was the port that the frame was received from, in which case the frame is discarded).

ARP is the protocol that converts IP addresses to HARDWARE addresses. There are some different variants of ARP apply to different networking technologies.

In the Ethernet protocols, the hardware addresses used are called MAC addresses.
Hosts on an Ethernet have a temporary table in memory that maps hardware
addresses to their corresponding IPs and vice versa.

Say host "A" wants to communicate with  the ip address of Host "B" on the same subnet.

Host "A" does not know Host "B"'s hardware address, so it can't communicate yet.

Host "A" sends a broadcast ARP request out, this is addressed to the Ethernet broadcast address  FF:FF:FF:FF:FF

It creates an "incomplete" entry in its ARP table to indicate it is waiting for a
response to its own ARP request.

The request essentially says...  "I am;  who has the IP address"
The request (like all Ethernet frames) contains Host A's hardware address.

The request is broadcast... all switches send the request out all ports on
the same VLAN except the one it came in on

Eventually Host B sees the broadcast.
Host B and all hosts that receive the ARP request take the IP address seen
in the ARP request ( and store that IP in their ARP cache with the
hardware address that host A announced.

Host B (only host B) then replies to the ARP request with an ARP reply, which is
 not broadcast but is instead directed to Host A's hardware address:

"Hello, my hardware address is say 12:34:56:78,  and I am"

The switches forward the request to the port associated in their tables with Host A's hardware address.

Eventually Host A receives the frame, and completes the ARP entry with

Once the ARP entry on host A has completed,  host A begins its first packet of
data to host B.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking Hardware-Other

From novice to tech pro — start learning today.