In Open shortest path first routing algorithm, the information about connected links is "flooded" throughout the network. How is flooding different from broadcasting?
Broadcasting is a term that is used on a broadcast domain, which is bounded by layer-3 (routers). Broadcasts are sent to a special broadcast address, both for layer-2 and layer-3. A broadcast cannot cross a layer-3 device, and every host in a broadcast domain must be interrupted and inspect a broadcast.
Flooding is used by a switch at layer-2 to send unknown unicast frames to all other interfaces. If a frame is not destined for a host which receives it, the host will ignore it and not be interrupted. This, too, is limited to a broadcast domain.
Flooding in OSPF (layer-3) means that the routes get delivered to every OSPF router in an area. It really has nothing to do with a broadcast. OSPF doesn't use broadcasts to send routes, it uses unicast or multicast to connect with its neighbors. Each OSPF router needs to have a full understanding of all the routers and routes in its area, and it tells all its neighbors about all its local routes, and any routes it hears about from other neighbors. (OSPF routers are unrepentant gossips.)
I will explain here in the context of switches(Layer 2)
When a switch receives a unicast frame(a frame with a specific mac address intended for a particular device), it looks for the frame's destination mac in its mac-address table. If there is no entry for the destination mac in its table, it will simply send the frame out to everyone connected to it's ports.
The frame is still a unicast frame, since it has a specific destination mac address in its header. The switch doesn't change any header data in the frame.
All the devices that receive the frame will compare the destination mac address in the frame with their own mac address and drops the frame if it doesn't match.
A broadcast frame is created by the host itself. A frame becomes a broadcast frame if the destination mac address is ffffffffffff. Usually the host creates this type of frames during the ARP process. When the switch receives a broadcast frame, it sends it out to everyone connected to it.
In flooding the switch sends the frame to all because it doesn't know how to reach the destination.
In broadcasting the host that created the frame itself addressed the frame to everyone.
A host send a packet to another host through a switch or router or both. A Broadcast can only happen at layer 3 which is the network layer. Flooding happen a Layer 2. A switch will send out a flood when the mac address is not in it table.
You do have switch that do layer 2 and Layer 3 however it the port is configured for layer 3 then layer 2 is not present at that port.
We sometimes in the industry call a flood a broadcast but it can not be. It seem the some people here have fell into that scenario